Viewing images that compressed using lossless algorithms
Image is decompressed before viewing for the most time.
It is not necessary to decompress it fully if this is very big image and you have preview of the top left cropped area - only needed rows could be decompressed up to visible part.
This is highly implementation dependent, some programs use system built-ins (Windows format BMP) some disregard this and use own (on other systems Windows BMP is not generally built-in).
It may be stored in RAM, on disk, translated to internal format. There is no reason to stick with one scheme.

There are no references as this is implementation specific.
But I can share with my own scheme: I always unpack compressed data, never depend on external libraries, store it on internal format and since I use it in image editor - I store in RAM last three operations used on images.
They can be huge (800k x 600k) so if that is the case I put only visible part to RAM.
Since BMP can come in up side down format and other compress techniques prevent me from mapping coordinates to file, I explicitly store them as small sized decompressed grid (something like Google Maps do).