Recompress



If the input image is higher quality than PageSpeed is set to produce then recompressjpeg will recompress the image to the lower quality setting. Otherwise PageSpeed will attempt to improve the compression of the image but won't reduce its quality. What does recompress mean? To compress again. The.avi is not the main issue.avi is just a container. The main issue is which codecs you use. Many (most?).avi vids use older style codecs (eg XviD) which are fine, but are larger for the same quality when compared to the later generation of codecs. You can typically get a tight encoding by using the H.264 video compression standard (eg. Codecx264) and aac compression for audio. Sebile Sea Qualizer SQL Recompress Tool, 50/100/150-Feet, black Angler's Choice FVT-001 Fish Venting Tool Booms Fishing R2 Hook Remover Squeeze-Out Fish Hook Tools 3 Colors Available.

Jpeg-recompress is a command-line tool which can cut JPEG file sizes by 50% or more.

The program works by intelligently selecting the lowest possible quality setting for your JPEG, which also has the minimum effect on its perceived visual quality.

The command line syntax is straightforward, and at a minimum you can get away with this.

jpeg-recompress in.jpg out.jpg

This tells jpeg-recompress to take the image in.jpg and process it at several lower quality levels. At each stage the program uses the structural similarity (SSIM) algorithm to measure the change in your image, and finally selects the lowest level that still gives you acceptable results.

We tried this out with a few sample HD photos. Processing was faster than we expected, 5 or 6 seconds to find the best quality level and save the image. File sizes were typically 50% to 25% of the original. Most important of all, there was no apparent difference between the 'before' and 'after' files.

If this doesn't quite work for you, there are various options to try. You could use a different algorithm to check your images, set a new 'acceptable' quality level to further shrink the files, and there's a 'strip metadata' switch to save the maximum amount of space.

Please note: the project download is 'jpeg-archive', but jpeg-recompress is one of the bundled files.

Verdict:
Recompress meaning

Jpeg-recompress is an interesting tool which can deliver spectacular results, significantly cutting file size while losing minimal image quality. If you don't mind running it from the command line, or are happy to set up your own scripts, it's a must-see.

jpeg-recompress is an application that is used to re-encodeJPEG images to the lowest possible JPEG quality that still keeps the perceived visualquality to a certain standard. JPEG uses lossy compression, so there will always belosses when re-encoding the image. The goal is to do the compression while making theimage look practically the same after the compression.

There are three important parameters that can be adjusted when choosing how thisalgorithm works:

Unfortunately, these parameters are barely described anywhere. So in this post I’lltry to do that.

Recompress

How jpeg-recompress works

jpeg-recompress compresses an image by lowering its JPEG quality, which is usuallyindicated by a number between 1 and 100. It does this by attempting to find a target,which is a number indicating the perceived quality of the image, e.g. 0.9999.Perceived quality is measured by algorithms such as SSIM. The JPEGquality for a given target is found by choosing two points, min and max, and thendoing a binary search between them. min and max are also JPEG quality numbers.

The quality parameter is simply a preset for the target value (this is for SSIM):

QualityTarget
low0.99900
medium0.99990
high0.99995
veryhigh0.99999


The target can also be set manually with the --target parameter.

Take, for instance, this image, which is 1.37 MB in size.

If I use jpeg-recompress with default settings (quality: medium, min: 40 and max: 95),I get this result:

We can see here that a search is being done between 40 and 95. First the span 40 to 95 iscut in half with 67 as the number in the middle. The number on the right end is the perceivedquality, as measured by SSIM, at the JPEG quality level listed on thesame line.

The target is 0.9999. Because 0.9998795 is less than 0.9999 the quality can beincreased by continuing the search with the upper half of the initial division, and a newsearch is done between 68 and 98. This continues until 0.999699 is found at JPEG quality 89.This is the value that will be used to compress the image.

The new image looks like this. The size is 867 kB. Good luck telling the difference betweenthis image and the one above.


Let’s continue with changing the quality to low. Low quality is a preset for target = 0.999.

Like before, the initial search conditions are between 40 and 95. The target that the searchlooks for is lower than before, so the optimal JPEG quality is now chosen to be 71.

If we want to lower the quality even further than low, we can either set target value manually,(rather than using a preset) or change the min and/or max values. As mentioned before, we canset the target manually with the --target parameter. Lets try with the following settings:target = 0.90000, min = 45 and max = 95.

Because min was set to 45 it refused to go below that, and the target was never reached. Let’s setmin to 0 and try again:

So we can see that target is the value jpeg-recompress searches for, while min and max aresaturations that it refuses to go below or above.

Let’s look at how min and max works more in depth. We will use the low quality preset again.

Changing min to 60 and max to 80, for example, will give this result:

We know that JPEG quality 71 was the optimal number for a target of 0.999, and 71 is stillwithin min and max, so the change didn’t help.

What happens if we decrease max to a number below 71? For example max = 50.

This will force jpeg-recompress to look for an optimal solution within the range 40-50. Thefound optimal quality is 51 (should have been 50, but there is a small bug in jpeg-recompress).The target quality was never found, because it reached the max limit before it was found.The image looks like this now and is 267 kB large.


jpeg-recompress can compress the image even further by reducing the max value even more.min is set to 1 and max is set to 5. The search is now forced to run between two verysmall numbers.

Recompressor

The image looks like this now and is 43.7 kB large. By forcing the max value to a smallnumber we are able to do fairly heavy compression. From the output above we can see thatthe search never came close to the target value. We got 0.911516 but were looking for0.9999. The image will therefore not have anything near the same perceived visual qualityas before, but will at least be compressed by a large amount.

Recompress

Compressing


Tl;dr

  • quality sets the target presets for how good the perceived quality has to be whencompressing. It will directly influence the quality of the compressed image.
  • target sets the target to a specific value if you need something else than thepresets. For example if low quality is not low enough.
  • min sets the lower limit of the binary search. The quality of the compressed image willnever go below this value.
  • max sets the upper limit of the binary search. The quality of the compressed image willnever go above this value + 1.
  • to get heavy compression, below what the default values provide, you can either setthe target manually (below what low quality provides), or set max to a small number.




Comments are closed.