2
$\begingroup$

I am just trying to understand a few minor details regarding images that are compressed with lossless algorithms such as RLE.

If a bmp image is compressed using RLE, when does the decompression occur when viewing the image? does the image viewer have a built-in library to decompress the image and then view it? or is it using a system library? Is the decompressed image file stored in the RAM temporarily?

Do you any references for this process?

$\endgroup$
2
$\begingroup$

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).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.