Computer techologies

WWW: JPEG Archive – a set of utilities for optimal photo compression

You select the Photos folder, request information and, while the computer thinks, you have time to estimate how much another hard disk will cost.The problem of the growing mountain of pictures is familiar to many photo enthusiasts, and if you sort and delete is not an output, then an interesting solution would be a set of scripts and utilities called the JPEG Archive.

The purpose of the JPEG Archive is to prepare large arrays of unnecessary pictures for long storage, compressing them exactly the same To the eye it was unnoticeable. Included:

  • jpeg-hash – gives an image hash – for further comparison with other hashes;
  • jpeg-compare – compares two pictures and tells how visually they are (in percents);
  • jpeg-recompress – compresses a photo several times and then selects an optimal size-quality ratio (the threshold can be adjusted);
  • jpeg-archive – a script that accepts The input is a set of snapshots and consistently applies previous utilities for duplication screening and compression.

I p ka that he did not communicate with the jpeg-archive: you need to put to him yet exiftool, dcraw and Ladon or GNU Parallel to work in parallel on multiple processor cores. But I played with jpeg-recompress as the most interesting utility of the entire set.

It’s hard to say what I was waiting for, but not exactly what the developer promised: compression with almost no visual changes with a decrease in the size of the source file from 30% to 70% default settings. And if the pictures taken on the Phone 6, the maximum percentage is reduced by 20, then several times more weighty shots of the iPhone X – already by 40-50%. And all this is complete nonsense compared to 70-80%, which lose huge images in weight with the Canon 7D. It was 10 megabytes, it was 2-3. Cool? But there must be a trick!

Of course, lossy compression always means … well, loss. Without an increase in the eye, there can be no difference, but under the “microscope” it is immediately obvious how warm lamp tube tags turn into cool digital squares. The whole point of JPEG!

However, if you are not going to do a sixfold increase and look at the noise of the matrix, then the results of jpeg-recompress are almost perfect. Only in one case, I noticed the difference, turning the frames back and forth (the bare branches of the bushes lost sharpness), but when I put the images side by side, it was no longer so obvious.

For special aesthetes, there is a key -a which prioritizes the accuracy of selection, neglecting the consumption of resources. In my opinion, the brakes are not worth it: the force of compression changes somewhere around 1%, which is completely imperceptible to the eye.