In this Tutorial, we combine the different scientific fields of information theory, thermodynamics, regularization theory, and non-destructive imaging, especially for photoacoustic and photothermal imaging. The goal is to get a better understanding of how information gaining for subsurface imaging works and how the spatial resolution limit can be overcome by using additional information. Here, the resolution limit in photoacoustic and photothermal imaging is derived from the irreversibility of attenuation of the pressure wave and of heat diffusion during the propagation of the signals from the imaged subsurface structures to the sample surface, respectively. The acoustic or temperature signals are converted into so-called virtual waves, which are their reversible counterparts and which can be used for image reconstruction by well-known ultrasound reconstruction methods. The conversion into virtual waves is an ill-posed inverse problem, which needs regularization. The reason for that is the information loss during signal propagation to the sample surface, which turns out to be equal to the entropy production. As the entropy production from acoustic attenuation is usually small compared to the entropy production from heat diffusion, the spatial resolution in acoustic imaging is higher than in thermal imaging. Therefore, it is especially necessary to overcome this resolution limit for thermographic imaging by using additional information. Incorporating sparsity and non-negativity in iterative regularization methods gives a significant resolution enhancement, which was experimentally demonstrated by one-dimensional imaging of thin layers with varying depth or by three-dimensional imaging, either from a single detection plane or from three perpendicular detection planes on the surface of a sample cube.