guetzli icon indicating copy to clipboard operation
guetzli copied to clipboard

Square artifacts in gradient

Open skohlmann opened this issue 6 years ago • 5 comments

The attached guetzli encoded JPEG (695330_a2_guetzli.jpg) contains squared artifats where other encoded images doesn't contain such artifacts. The image was created with --quality 90.

The attached guetzli encoded JPEG was created by the Mister Spex glass frames production image pipeline. This pipeline is highly optimized for glass frame images. It based on SSIM (DSSIM version 0.9 http://pornel.net/dssim) and tries to find the optimal quality value for a given encoder to reach a give dissimilarity value.

The JPEG encoders are:

  • CJPEG, version 9b 17-Jan-2016
  • MOZJPEG version 3.1 (build 20160818)
  • guetzli 1.0.1

The encoders are executed with different parameter:

  • mozjpeg: -progressive -optimize -sample 2x2 -tune-ms-ssim -quant-table 2 -dc-scan-opt 2
  • cjpeg 9b: -progressive -optimize -sample 2x2

The final images are encoded with the following quality values:

  • guetzli: 90
  • mozjpeg: 96
  • cjpeg: 95

After image creation jpegrescan optimizes the Huffman table. In case all 3 images are calculated, the algorithm selects the image with the lowest files size.

I've attached the results. Additional I attached the source PNG file and the current Photoshop image from production site.

It will be fine to fix the square artifact problem.

Thx

6695330_a2_cjpeg9b 6695330_a2_guetzli 6695330_a2_mozjpeg 6695330_a2_photoshop 6695330_a2

skohlmann avatar Jan 19 '18 20:01 skohlmann

+1. I am also seeing this in some of my images at different quality levels.

mdelarioja avatar Apr 11 '18 17:04 mdelarioja

@mdelarioja Which version of Guetzli are you using? Which quality levels do you observe the problem? Could you share the image, too?

While there is no full solution to this problem yet, there might be a mitigation: I think current version of Guetzli reads the png as an 8-bit image and if your source is 16 bits, you may possibly get better results by converting the source into an 8-bit images using dithering.

I will give it a try to solve this properly during the next two months.

jyrkialakuijala avatar Apr 17 '18 00:04 jyrkialakuijala

@jyrkialakuijala I'm very excited to hear that work is still being done on this project!

I am using guetzli through imagemin, and I am actually using guetzli to optimize high quality JPGs exported from Lightroom. I see similar artifacts at different levels, all the way up to quality 95 (haven't tried going above that, though).

mdelarioja avatar Apr 17 '18 00:04 mdelarioja

I will be trying a new candidate fix for this problem -- to make butteraugli asymmetric in relation to high frequency artefacts, i.e., to punish smoothing less than adding new sharp (high frequency) artefacts. I expect to be able to do this in three weeks.

jyrkialakuijala avatar Jun 13 '18 23:06 jyrkialakuijala

@jyrkialakuijala That's great news! Thank you for your amazing work on this.

mdelarioja avatar Jun 13 '18 23:06 mdelarioja