Suitable detection systems that are capable of recording high photon count rates with single-photon detection are instrumental for coherent X-ray imaging. The new single-photon-counting pixel detector 'Lambda' has been tested in a ptychographic imaging experiment on solar-cell nanowires using KirkpatrickBaez-focused 13.8 keV X-rays. Taking advantage of the high count rate of the Lambda and dynamic range expansion by the semi-transparent central stop, a high-dynamic-range diffraction signal covering more than seven orders of magnitude has been recorded, which corresponds to a photon flux density of about 10 5 photons nm À2 s À1 or a flux of $10 10 photons s À1 on the sample. By comparison with data taken without the semi-transparent central stop, an increase in resolution by a factor of 3-4 is determined: from about 125 nm to about 38 nm for the nanowire and from about 83 nm to about 21 nm for the illuminating wavefield.