Optimal lossy compression of images

3

2

I have a lot of images/documents, where I want quite a low filesize, without throwing away to much information, or cause generation loss with future compression.

A) Documents, business cards etc where I want to be able to read or OCR the text. Also some information like color-resolution might be less important.

B) Regular photos (Holidays etc.) Where I want to preserve sufficient details. (But the filesize from the camera is probably much larger than needed)

Are there any tools that can assist me with doing this?

(29 April) More about finding the optimal size/loss than which technique is most efficient.

Olav

Posted 2012-04-21T23:09:38.207

Reputation: 626

Answers

4

If it's possible for you to sort the documents and photos, I would suggest a 256-color PNG for the documents (you can do this with IrfanView) without dithering, afterwards use PNG Optimizer on the results.

If used on scanned documents, they will, without even resizing, shrink from ~20 MB bitmaps to ~400 KB pngs.

I have no suggestion for the photos.

gbag

Posted 2012-04-21T23:09:38.207

Reputation: 591

2

In addition to user129552's suggestion, most photos (genuine photos, not scanned documents, logo images, etc.) are optimally compressed using JPEG. But you should avoid recompressing JPEGs that were already compressed at medium or low quality settings, as it will significantly increase compression artifacts and lower the quality:compression ratio.

If the images are logos or other graphics suitable for vector graphics, then obtaining the vector original, autotracing a hi-res raster image, or having it professionally hand-traced would provide the best quality with minimal file size. You can replace a 25MB hi-res image with a 256kb SVG or AI file.

If you have access to the original lossless or high-quality lossy image, you can also try Google's WebP format:

WebP is a new image format that provides lossless and lossy compression for images on the web. WebP lossless images are 28% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at equivalent SSIM index. WebP supports lossless transparency (also known as alpha channel) with just 22% additional bytes. WebP also supports features such as animation, ICC color profile, XMP meta-data and tiling.

Lèse majesté

Posted 2012-04-21T23:09:38.207

Reputation: 3 129