We propose a signal-to-noise criterion which predicts whether a feature of a given size and scattering strength, placed inside a larger object, can be retrieved with two common X-ray imaging techniques: coherent diffraction imaging and projection microscopy. This criterion, based on how efficiently these techniques detect the scattered photons and validated through simulations, shows in general that projection microscopy can resolve smaller phase differences and features than coherent diffraction imaging. Our criterion can be used to design optimized imaging experiments and perform feasibility studies for sensitive biological materials in free-electron lasers, where the number of photons per pulse is limited, or in synchrotron experiments, for both techniques.