The spectroscopic and imaging performance of energy-resolved photon counting detectors, based on new sub-millimetre boron oxide encapsulated vertical Bridgman cadmium zinc telluride linear arrays, are presented in this work. The activities are in the framework of the AVATAR X project, planning the development of X-ray scanners for contaminant detection in food industry. The detectors, characterized by high spatial (250 µm) and energy (<3 keV) resolution, allow spectral X-ray imaging with interesting image quality improvements. The effects of charge sharing and energy-resolved techniques on contrast-to-noise ratio (CNR) enhancements are investigated. The benefits of a new energy-resolved X-ray imaging approach, termed window-based energy selecting, in the detection of low- and high-density contaminants are also shown.