guetzli icon indicating copy to clipboard operation
guetzli copied to clipboard

Image optimized further after running optimizer on original image

Open kevaldsoni opened this issue 9 years ago • 7 comments

I ran image compression on original image of size 1.9 MB. The resultant image was of size 1.2 MB.

Further, I ran image compression on resultant image of size 1.2 KB and the next output image was of size 984 KB.

Seems like the complete lossless compression is not done in first run of compression on original image.

kevaldsoni avatar Apr 06 '17 19:04 kevaldsoni

Interesting. It never occurred to me to re-run it on the same image.

Are you sure the compression is lossless? I'd be worried about gradual degradation being introduced by each subsequent pass.

I'm going to rerun guetzli on my test bank of images and see what kind of result I get. It's a large file set which was originally 849MB reduced to 586MB after one pass. I'll report back on how much I save a second time, though it may take a couple of weeks -- my VPS is running it 24/7 but isn't the most powerful.

mgrhm avatar Apr 06 '17 20:04 mgrhm

There is generation loss in guetzli images. One should run guetzli only once. The same applies to most lossy compression.

https://en.wikipedia.org/wiki/Generation_loss

jyrkialakuijala avatar Apr 06 '17 21:04 jyrkialakuijala

Following up on this, I ran a single test image through guetzli nine times, recompressing the output of the previous run each time. Every single run produced a smaller file:

original.jpg       2119K
first-pass.jpg     1708K
second-pass.jpg    1484K 
third-pass.jpg     1309K
fourth-pass.jpg    1195K
fifth-pass.jpg     1115K
sixth-pass.jpg     1067K
seventh-pass.jpg   1041K
eight-pass.jpg     1028K
ninth-pass.jpg     1022K

The photo was a group shot taken with an iPhone SE. The compression is greatest for the first two runs, then dramatically tails off. There wasn't any noticeable quality degradation from one shot to the next that I could see.

Given that there is generation loss, I would agree with @jyrkialakuijala that it's best not to process an image more than once unless the size saving is more important than the image quality.

mgrhm avatar Apr 08 '17 10:04 mgrhm

Given that there is generation loss, I would agree with @jyrkialakuijala that it's best not to process an image more than once unless the size saving is more important than the image quality.

Even then, don't process it multiple times: just use Guetzli at a lower quality. Using an appropriate quality and prcessing the image once gives a much better quality/size tradeoff.

robryk avatar Apr 08 '17 10:04 robryk

just use Guetzli at a lower quality. Using an appropriate quality and prcessing the image once gives a much better quality/size tradeoff.

Good point. I haven't used that function of guetzli.

mgrhm avatar Apr 08 '17 10:04 mgrhm

There are also lossless ways to get extra compression out of all JPEGs. Best of techniques are in ImageOptim (MacOS) & FileOptmiizer (Win).

tomByrer avatar Apr 27 '17 06:04 tomByrer

I also found that sometimes Guetzli is unable to run on a file which is created by itself :). To be more specific: https://github.com/google/guetzli/issues/196

rogierlommers avatar Apr 27 '17 07:04 rogierlommers