Page 1 of 1

Compression v/s Size(Dimension)

Posted: 2018-05-09T10:08:13+00:00
by dkode
If image size is small, it can be compressed with lower quality as smaller images are less susceptible to perceptual changes, while larger images can be differentiated easily.
Anybody aware of such study that provide sane values of compression with respect to dimensions(Area)?

Re: Compression v/s Size(Dimension)

Posted: 2018-06-06T17:37:06+00:00
by Meloware
You have touched on a subject I wish was asked more often. I am the self styled “media guy” at the Museum of Our Industrial Heritage ( We are limited in budget and own or have been loaned many wonderful vintage documents and images. I also copy frame-by-frame movie film as raw image sequences. Each of the 21,000 frames in a 15 minute film capture in my DSLR as individual 32Mb files and this makes gigantic demands on hard drive storage. It gets very expensive storing terabytes of data.

It is a waste of time scanning a rare photo at a resolution and color depth inferior to the quality of the original artifact. The big challenge is in the best compromise between cost and quality.

I will discuss more, if this thread attracts interest, but I think it is obvious to everyone that lossy compression applied to low resolution images produce horrible results. JPEG only supports 8 bit color and B&W. This severely limits the value of these stored images for any future editing.

I have become a big fan of the JPEG2000 standard. It has both lossy and lossless modes, and will support all sorts of color depths besides just 8 bits per color. I am able to archive 16 bit greyscale images with 85% compression with almost no noticeable difference at the macro level!

I believe the success in using a lossy compression is to create images with a very high pixel per inch density. I am open for discussion, but I generally believe you need to scan at a pixel diameter which is one quarter the diameter of the smallest meaningful detail in your image source. If my 2400dpi scan is resolving the fibers of a original paper print, then who cares if detail at this level has a few artifacts from lossy compression? The usable image detail is still intact and not distorted. Saving a 16 bit greyscale 2400dpi Tiff as a JP2 (JPEG2000) image with 75% compression saves my hard drive costs and still archives a splendid image, fully capable of future projects and edits.

Before deciding what resolution, bit depth, and compression you wish to use, you must first discover the smallest detail you need to capture and preserve. I would very much appreciate other experienced ImageMagick users coming forward to explore this subject more!

Re: Compression v/s Size(Dimension)

Posted: 2018-06-06T20:03:20+00:00
by snibgo
I agree that ordinary lossy 8-bit JPEG is horrible, and JPEG2000 is superior. I wish it was more widely supported (eg in browsers).

One difficulty with photos on film is that they are already sampled, in the form of grain, so digitising is a re-sampling process. I suppose it's an aesthetic question: do we want to digitise the grain?

Aside from that, if I understand Nyquist–Shannon sampling theorem, we need to sample at only double the required level of detail. But the big test, especially with movies, is "does it look right?"

Re: Compression v/s Size(Dimension)

Posted: 2018-06-06T20:34:27+00:00
by Meloware
Okay - double the finest detail. Digital sampling should always be performed to a degree of detail that is greater than the human senses, in the finest context the item may be used. This is also true for digitizing sound recordings. Half-tone images, such as those published in books and newspapers, should have each dot clearly resolved. If not, "herring bone" patterns may be produced in the scan. The finely scanned individual dots may then have a Gaussian blur performed to create a true range of grey, when they are "melted together". This will allow image editor filters, like gamma, brightness, etc., to be performed. Any of the book published images on my website use this technique.
Personally, I would scan down to the grain if possible. That would be as good as it could get and would avoid the need to do it again in the future. Also, don't crop an archival scan. Let the future archivist know you are providing them everything that existed when you originally did the work.