X-rays and gamma rays have the ability to penetrate matter. During the penetration the radiation dose is decreasing depending on the material specification (basically density) and the thickness. Radiation-sensitive detectors (e.g. X-ray films or digital detectors) can capture the dose distribution behind the object two-dimensionally, which produces an X-ray image. On X-ray films the optical density increases with the dose rate. With digital detectors the gray value display is usually opposite.
A void or a material inclusion with lower density than the basic material (e.g. slag in steel casting) causes less radiation absorption. Therefore it can be made visible as a dark indication on the X-ray film. Inclusions with higher density and as a result higher absorption can be detected as lighter indications.
Unsharpness in an X-ray image is unavoidable. Its degree is basically depending on the size of the focal spot of the X-ray tube or the size of the gamma source, the distances between source, object and detector and on the detector itself.
The higher the energy of the radiation, the less percentage of radiation is absorbed by the object. This will cause a poorer contrast but also a better ability to penetrate matter.
Therefore one usually increases the x-ray energy for thicker walls and denser materials. Inside the material a portion of the primary radiation is converted into undirected secondary scattered radiation with lower energy. Scattered radiation decreases contrast and therefore image quality, because it exposes the detector or film without delivering image information. Metal filters placed between object and detector in order to reduce mainly the low energy scattered radiation can reduce this effect only slightly.