Page 1 of 3 123 LastLast
Results 1 to 30 of 61

Thread: Guetzli - a new more psychovisual JPEG encoder

  1. #1
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts

    Guetzli - a new more psychovisual JPEG encoder

    We are opensourcing guetzli, a "zopfli-like" extremely slow jpeg-encoder at https://github.com/google/guetzli/

    It produces the same butteraugli score as libjpeg with about 35 % less bytes. The resulting images transfer and decode about 35 % faster, only the encoding is slow.

    The (color) SSIM and PSNRHVS-M ratings are worse (13-14 % worse) than for libjpeg, butteraugli ratings better (30 %), the images look better with less blocky and noisy jpeg artefacts.

  2. The Following 13 Users Say Thank You to Jyrki Alakuijala For This Useful Post:

    AiZ (21st October 2016),boxerab (29th December 2016),Cyan (24th October 2016),Jaff (4th January 2017),load (21st October 2016),lorents17 (21st October 2016),Malloc Voidstar (24th October 2016),Mike (5th November 2016),nemequ (24th October 2016),pothos2 (23rd October 2016),samsat1024 (28th January 2017),SolidComp (24th October 2016),Turtle (22nd October 2016)

  3. #2
    Member
    Join Date
    May 2009
    Location
    France
    Posts
    95
    Thanks
    13
    Thanked 72 Times in 42 Posts
    Hello,

    win32 binary, barely tested, be warned.
    guetzli_win32.7z

    AiZ

  4. The Following User Says Thank You to AiZ For This Useful Post:

    lorents17 (21st October 2016)

  5. #3
    Member
    Join Date
    Apr 2012
    Location
    Stuttgart
    Posts
    437
    Thanks
    1
    Thanked 96 Times in 57 Posts
    Quote Originally Posted by Jyrki Alakuijala View Post
    We are opensourcing guetzli, a "zopfli-like" extremely slow jpeg-encoder at https://github.com/google/guetzli/ It produces the same butteraugli score as libjpeg with about 35 % less bytes. The resulting images transfer and decode about 35 % faster, only the encoding is slow. The (color) SSIM and PSNRHVS-M ratings are worse (13-14 % worse) than for libjpeg, butteraugli ratings better (30 %), the images look better with less blocky and noisy jpeg artefacts.
    Thanks, very good! Any chances that you provide some insight into how it works? Do you plan a publication on this? I'm asking because as part of the Grand Challenge on Image Compression, we (the JPEG) also tested a "smart" JPEG encoder (there termed "JPEG on Steroids"), including subjective tests. The presentation should become available in a couple of days on www.jpeg.org. The technique here is essentially the same as in mozjpeg, i.e. soft-threshold quantization based on dynamic programming and a better quantization matrix (that from imagemagick). Results indicate that the visual performance of "JPEG on Steroids" can be very competitive at high bitrates. There is also a paper on that at IEEE explorer, but due to size constraints, it is pretty sketchy and shows only limited results. However, it includes many references I would recommend going through to understand the details of the technology. If there is some interest, I can provide the preprint to interested members.

  6. #4
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by thorfdbg View Post
    Thanks, very good! Any chances that you provide some insight into how it works? Do you plan a publication on this? I'm asking because as part of the Grand Challenge on Image Compression, we (the JPEG) also tested a "smart" JPEG encoder (there termed "JPEG on Steroids"), including subjective tests. The presentation should become available in a couple of days on www.jpeg.org. The technique here is essentially the same as in mozjpeg, i.e. soft-threshold quantization based on dynamic programming and a better quantization matrix (that from imagemagick).
    Main differences between mozjpeg and guetzli are that guetzli is a lot slower (perhaps 100x), guetzli optimizes for butteraugli, and guetzli produces a non-progressive jpeg (for faster decoding), and guetzli targets quality range 90–100. Probably most testing and optimization we did around quality 95.

    We plan to write a blog post and a short technical report during the next two weeks. It would be very nice to get some feedback from the experts here before that.

    Guetzli includes global optimization for quantization matrix selection, but also local visual masking etc. based further zeroing of coefficients. Basically all butteraugli's modeling techniques are used in guetzli. Guetzli is rather slow and complex because a lot of butteraugli's modeling is not directly compatible with jpeg.

  7. #5
    Member
    Join Date
    Jul 2014
    Location
    Mars
    Posts
    164
    Thanks
    115
    Thanked 10 Times in 9 Posts
    can it be lossless? what input formats?

  8. #6
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by necros View Post
    can it be lossless? what input formats?
    It is not intended for lossless coding. However, the default quality of 95 should give visually lossless results with 35 % less bytes than libjpeg.

    It is good to note that if your monitor has 8-bit gamma correction LUTs, some "visually lossless" changes can become detectable. The same can happen with other color anomalies, like non-sRGB colors.

    Guetzli ignores possible ICC color profiles in the input, and assumes sRGB.

    Input images can be png (without alpha) or jpeg. For decent results with jpeg, it is best to use quality 100 yuv444 input images.

  9. #7
    Member
    Join Date
    Apr 2012
    Location
    Stuttgart
    Posts
    437
    Thanks
    1
    Thanked 96 Times in 57 Posts
    Quote Originally Posted by necros View Post
    can it be lossless? what input formats?
    The popular DCT mode of JPEG is not lossless, as it allows some leeway in the DCT implementation (how much leeway is allowed is defined in 10918-2, JPEG part 2). There *is* a lossless JPEG mode, but that's a completely different codec. It only uses predictive coding, and for that reason performs quite bad. If you want a lossless JPEG extension that allows (lossy) decoding by legacy JPEG implementations, your best bet is JPEG XT Part 8, which defines exactly that.

  10. #8
    Member
    Join Date
    Apr 2012
    Location
    Stuttgart
    Posts
    437
    Thanks
    1
    Thanked 96 Times in 57 Posts
    Quote Originally Posted by Jyrki Alakuijala View Post
    We plan to write a blog post and a short technical report during the next two weeks. It would be very nice to get some feedback from the experts here before that.
    Would be interested in that.
    Quote Originally Posted by Jyrki Alakuijala View Post
    Guetzli includes global optimization for quantization matrix selection, but also local visual masking etc. based further zeroing of coefficients.
    In such a case, I suggest to look into "DCTune", an old work by Watson, which uses similar techniques. "Zeroing coefficients" is just another name for "soft threshold quantization", which you find in mozjpeg.

  11. #9
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by thorfdbg View Post
    I suggest to look into "DCTune", an old work by Watson, which uses similar techniques.
    Is DCTune better in compressing than mozjpeg?

  12. #10
    Member
    Join Date
    Apr 2012
    Location
    Stuttgart
    Posts
    437
    Thanks
    1
    Thanked 96 Times in 57 Posts
    Quote Originally Posted by Jyrki Alakuijala View Post
    Is DCTune better in compressing than mozjpeg?
    I do not know. I do not have an implementation of it at this time.

  13. #11
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    The quantization decisions in guetzli are not done based on the DCT itself in yuv space, but on butteraugli scores. In butteraugli the most important factor in error accumulation is an overlapping 8x8 FFT (sampled at every three pixels) in the new XYB color space. Because of the new different psychovisual metric and relatively exhaustive methods to explore it guetzli gives worse SSIM and PSNRHVS-M than libjpeg, only better when measured with butteraugli or human raters.

  14. #12
    Member SolidComp's Avatar
    Join Date
    Jun 2015
    Location
    USA
    Posts
    222
    Thanks
    89
    Thanked 46 Times in 30 Posts
    Nice work! This is approaching webp numbers, and with faster decode.

    I second AiZ's warning about the Windows binary. Some general feedback for you and Google is that the lack of Windows support for all these Google projects is incredibly frustrating. Windows is much more popular than Mac, some people like having actual graphics cards in their computers, some people like having more than one choice of laptop or desktop, some people like the Windows UI better than the feminine Mac UI, some people are not impressed with paleoOSes like Unix or with steampunk command-line interfaces, etc... Many of these people are developers. Google projects are much harder to use than, for example, Facebook's Zstd, which comes with first-class Windows support, Windows binaries, etc. In contrast, brotli, Guetzli, et al. are very difficult to get started with. (Ironically, the build tool that Guetzli requires – Bazel – is written in Java, so I guess write once-run anywhere was overplayed. The same thing happened with the Java-based Caja web sanitizer – Google developers seemed surprised someone would expect a Java application to run on the most popular OS in the world.)

    The build system is too complicated. For example:

    Currently, we use python wrapper scripts to call the actual MSVC compiler, so please make sure Python is installed and its location is added into PATH.
    Why do you need to mess with scripts calling the MSVC compiler? Why not just use MSVC normally? And the fact that it specifically requires Python 2.7 is annoying. Google loves old-ass technologies, old insecure OSes, Java, etc. I never use Python 2 for anything – I've been on 3 for years now. By my count, in order to use Guetzli, I have to install Bazel, whose Windows version Google is calling "highly experimental", and which in turn requires that I install msys2, Python 2.7, Java, and within the msys2 framework I have to install gcc, git, curl, zip, unzip, and zlib-devel. (What is unzip, and why is it separate from zip?)

    It's not normal to require all these installs in order to build a simple codec. Guetzli is written in C++. Perhaps Google doesn't know that Windows has C++ APIs? If anything, Windows is more C++-friendly than paleoOSes like the Unix-like constellation. There are rich, native C++ APIs, including Win32, C++/CX, and the new Universal Windows Platform, which I think MS Edge was built for. It would be much easier if you just created a Visual Studio C++ project for the Windows version.

  15. The Following User Says Thank You to SolidComp For This Useful Post:

    Jyrki Alakuijala (24th October 2016)

  16. #13
    Member
    Join Date
    Feb 2016
    Location
    USA
    Posts
    41
    Thanks
    27
    Thanked 63 Times in 24 Posts
    Since this does not support color profiles, does anyone know how to take a color-profiled PNG, pass it to this, and re-add the color profile without damaging colors at any point? Or at least best way to handle profiled PNGs? I have a simple custom image optimization system for targeting web but input is both profiled/unprofiled PNG/JPG.

  17. #14
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by SolidComp View Post
    Why do you need to mess with scripts calling the MSVC compiler? Why not just use MSVC normally? And the fact that it specifically requires Python 2.7 is annoying. Google loves old-ass technologies, old insecure OSes, Java, etc. I never use Python 2 for anything – I've been on 3 for years now. By my count, in order to use Guetzli, I have to install Bazel, whose Windows version Google is calling "highly experimental", and which in turn requires that I install msys2, Python 2.7, Java, and within the msys2 framework I have to install gcc, git, curl, zip, unzip, and zlib-devel. (What is unzip, and why is it separate from zip?)
    Would you consider filing an issue against guetzli at https://github.com/google/guetzli/ ?

    That would help us to propagate the issue properly to the bazel folks.

  18. #15
    Tester
    Nania Francesco's Avatar
    Join Date
    May 2008
    Location
    Italy
    Posts
    1,565
    Thanks
    220
    Thanked 146 Times in 83 Posts
    Code::blocks with GCC 4.9.2

  19. #16
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by Malloc Voidstar View Post
    I have a simple custom image optimization system for targeting web but input is both profiled/unprofiled PNG/JPG.
    Guetzli only knows how to deal with sRGB images. Temporarily removing the color profile will trick guetzli to perform badly, color profiles are not always a subtle thing and we have seen visible artefacts because of this. The two options that you have:
    1) Don't guetzlify images with a non-sRGB color profile.
    2) Convert images first to sRGB. See https://imageoptim.com/color-profiles.html how to do it.

  20. The Following User Says Thank You to Jyrki Alakuijala For This Useful Post:

    Malloc Voidstar (25th October 2016)

  21. #17
    Member
    Join Date
    Mar 2016
    Location
    Croatia
    Posts
    181
    Thanks
    74
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by AiZ View Post
    Hello,

    win32 binary, barely tested, be warned.
    guetzli_win32.7z
    AiZ

    C:\Downloads\guetzli_win32>guetzli -quality 68 -verbose testimage.png testimage.jpg
    Guetzli should be called with quality >= 84, otherwise the
    output will have noticeable artifacts. If you want to
    proceed anyway, please edit the source code.
    Guetzli processing failed

    I cant go below 84 quality, ....can you compile win binary with ability to be able to go under 84 quality. Thank you in advance

  22. #18
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by dado023 View Post
    I cant go below 84 quality, ....can you compile win binary with ability to be able to go under 84 quality. Thank you in advance
    I think nothing good will happen there. Butteraugli becomes less reliable there, and guetzli finds the anomalies. At somewhere around 75 or 80 guetzli is equally good with other approaches, just a lot slower.

    It is possible that we will fix this later, but it is non-trivial to do. Probably requires more than a year to fix it properly.

  23. #19
    Member
    Join Date
    Mar 2016
    Location
    Croatia
    Posts
    181
    Thanks
    74
    Thanked 10 Times in 10 Posts
    speed is not my main focus, just high compression ratio which saves space and bandwidth, thats why i am wondering what results would i get from Q60 , but it doesnt allow me to go below Q84

  24. #20
    Member
    Join Date
    May 2009
    Location
    France
    Posts
    95
    Thanks
    13
    Thanked 72 Times in 42 Posts
    Hi,

    According to values defined in quality.cc, a new win32 binary that can go down to 70.
    guetzli_70_win32.7z

    AiZ

  25. The Following 2 Users Say Thank You to AiZ For This Useful Post:

    dado023 (5th November 2016),Jyrki Alakuijala (7th November 2016)

  26. #21
    Member
    Join Date
    Mar 2016
    Location
    Croatia
    Posts
    181
    Thanks
    74
    Thanked 10 Times in 10 Posts
    I would kindly ask for fresh win binary compile, beacuse i see changes since 8days ago:
    https://github.com/google/guetzli

    ....cant find any changelog tho

  27. #22
    Member
    Join Date
    Mar 2016
    Location
    USA
    Posts
    47
    Thanks
    5
    Thanked 22 Times in 14 Posts

  28. #23
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by dado023 View Post
    I would kindly ask for fresh win binary compile, beacuse i see changes since 8days ago:
    https://github.com/google/guetzli

    ....cant find any changelog tho
    https://github.com/google/guetzli/releases/tag/v0.1 has Windows binaries

    Changes are compatibility and convenience maintenance -- we are not making algorithmic changes to guetzli now, and will likely keep it stable for a year or two.

  29. The Following User Says Thank You to Jyrki Alakuijala For This Useful Post:

    dado023 (29th December 2016)

  30. #24
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by MegaByte View Post
    There are two separate problems in lossy compression. How to better decorrelate the world, and how to throw data away so that no one notices (or gets least disturbed). Deep learning deals with the first and MS-SSIM, saliency and PSNR-HVS are likely not alone powerful enough to guide deep learning to do the correct things for throwing data away. For example, an optimization system could figure out how to store the averages and variances for SSIM and just reconstruct a signal that has the same averages and variances. Such a picture would score very well, compress wonderfully, but look awful. PSNR-HVS is more difficult to fool, but it is not much better than the internals of JPEG.

  31. #25
    Member
    Join Date
    Mar 2016
    Location
    Croatia
    Posts
    181
    Thanks
    74
    Thanked 10 Times in 10 Posts
    I am trying to use Guetzli from https://github.com/google/guetzli/re...indows_x86.exe but i keep getting Guetzli crashing with hi-resolution image.
    Let me know if you interested, so i could send you the image. File size is 26MB.

    I am using WIN 7 64bit Home Premium.

    http://i.imgur.com/1yKU548.png

    Code:
    Problem signature:  Problem Event Name:	APPCRASH
      Application Name:	guetzli_windows_x86.exe
      Application Version:	0.0.0.0
      Application Timestamp:	585a9cb0
      Fault Module Name:	guetzli_windows_x86.exe
      Fault Module Version:	0.0.0.0
      Fault Module Timestamp:	585a9cb0
      Exception Code:	40000015
      Exception Offset:	0004f670
      OS Version:	6.1.7601.2.1.0.768.3
      Locale ID:	1050
      Additional Information 1:	6ebd
      Additional Information 2:	6ebd59b85628b392e56e01a60c0ac39b
      Additional Information 3:	2433
      Additional Information 4:	243311d7b2fdf9df221ebbe5b62e16da
    
    
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    
    
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt

  32. #26
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by dado023 View Post
    We are looking into this and will provide new binaries soon.

  33. The Following User Says Thank You to Jyrki Alakuijala For This Useful Post:

    nikkho (12th January 2017)

  34. #27
    Member nikkho's Avatar
    Join Date
    Jul 2011
    Location
    Spain
    Posts
    542
    Thanks
    214
    Thanked 163 Times in 104 Posts
    Quote Originally Posted by Jyrki Alakuijala View Post
    We are looking into this and will provide new binaries soon.
    Nice!

  35. #28
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    Quote Originally Posted by nikkho View Post
    Nice!
    We have fixed the problem and uploaded new binaries.

  36. The Following User Says Thank You to Jyrki Alakuijala For This Useful Post:

    nikkho (19th January 2017)

  37. #29
    Member
    Join Date
    Jun 2015
    Location
    Switzerland
    Posts
    667
    Thanks
    204
    Thanked 241 Times in 146 Posts
    https://twitter.com/fg118942/status/820984186974584832 shows an interesting reversal of codecs.

    Guetzli is the worst on SSIM and PSNR, but best on butteraugli. This is really not a miracle nor a proof of its superiority since guetzli is just a complex optimizer for butteraugli rating.

    Ordering of codecs with ssim:
    1. BPG
    2. JPEG XR/JPEG 2000
    3. Mozjpeg
    4. JPEG
    5. Guetzli

    Ordering of codecs with butteraugli:
    1. Guetzli
    2. BPG
    3. Mozjpeg/JPEG
    4. JPEG 2000
    5. JPEG XR

    I have read that human raters like JPEGs more than similarly sized JPEG 2000 and JPEG XR, but ssim and psnr consistently rank them the opposite as humans tend to do.

  38. The Following 2 Users Say Thank You to Jyrki Alakuijala For This Useful Post:

    Cyan (18th January 2017),pothos2 (18th January 2017)

  39. #30
    Member
    Join Date
    Apr 2012
    Location
    Stuttgart
    Posts
    437
    Thanks
    1
    Thanked 96 Times in 57 Posts
    Quote Originally Posted by Jyrki Alakuijala View Post
    I have read that human raters like JPEGs more than similarly sized JPEG 2000 and JPEG XR, but ssim and psnr consistently rank them the opposite as humans tend to do.
    Frankly, I wouldn't thrust SSIM much, and hence - if you want to compare - may I suggest to rather make a comparison with VDP 2.2?

  40. The Following User Says Thank You to thorfdbg For This Useful Post:

    Jyrki Alakuijala (19th January 2017)

Page 1 of 3 123 LastLast

Similar Threads

  1. JPEG XT Demo software available on jpeg.org
    By thorfdbg in forum Data Compression
    Replies: 40
    Last Post: 16th September 2015, 15:30
  2. Replies: 9
    Last Post: 11th June 2015, 23:28
  3. Replies: 0
    Last Post: 6th February 2015, 06:57
  4. PPMX - a new PPM encoder
    By encode in forum Data Compression
    Replies: 14
    Last Post: 30th November 2008, 17:03
  5. about files to test encoder
    By Krzysiek in forum Data Compression
    Replies: 3
    Last Post: 9th July 2008, 21:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •