We present the development of a CZT-based detection module dedicated to X-ray diffraction imaging. This kind of application requires a good energy and spatial resolution in order to resolve Bragg peaks.In a first part, we present the detector configuration used and dimensioning constraints. As the input energy range is comprised between 20 and 150 keV, we use 5 mm thick high resistivity CZT crystals. The 660 mm 2 detection area is segmented on both sides into 192 anodes and 12 cathodes. Signals from both sides are read jointly in order to perform multiparametric event corrections (depth of interaction, charge sharing, induction sharing). In order to be integrated easily inside an X-ray imaging system, the system has been conceived to be completely autonomous: it is powered by a single 12V supply and is interfaced with the external system by Ethernet for communication and RS485 for synchronization.In a second part, we describe the system readout architecture and then the implementation of the data processing. An FPGA circuit embeds a digital processing chain that carries out readout ASIC interfacing and advanced multiparametric data corrections. Gain, offset but also depth of interaction and charge sharing are corrected on the flow. Incoming events from different channels are clustered together by comparing their location and time of occurrence. The FPGA also embeds a processor running an operating system that controls the system, carries out all calibrations, automated tests and acquisitions.Eventually, we show the results obtained and demonstrate the relative influence of depth of interaction and charge sharing. Homogeneity of detector behavior is also discussed and the reproducibility of the performance between modules is presented. The average energy resolution at 25 o C is 2.4 % FWHM at 122 keV and 3.8 % FWHM at 60keV and the average efficiency is 73 %.