This sketch does a radon-transform. In short we consider a ray for a given angle and displacement from the origin (blue ray when hovering over the right image). Depending on how many dots this ray passes through the resulting pixel is lighter/darker.
This is the Image one gets when doing an X-ray or MRI. Then the inverse radon transform can be done to get the original image.