Google's new algorithm shrinks JPEG files by 35 percent
The Guetzli encoder could literally cut down the size of the web.
...If you want to get technical, Guetzli (Swiss German for "cookie") targets the quantization stage of image compression, wherein it trades visual quality for a smaller file size. Its particular psychovisual model (yes, that's a thing) "approximates color perception and visual masking in a more thorough and detailed way than what is achievable" in current methods. The only tradeoff: Guetzli takes a little longer to run than compression options like libjpeg. Despite the increased time, Google's post assures that human raters preferred the images churned out by Guetzli. Per the example below, the uncompressed image is on the left, libjpeg-shrunk in the center and Guetzli-treated on the right.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Performance of jpeg decoding with Libjpeg version 8d
It may be of interest to investigate the performance of Libjpeg compiled with the various GCC optimization flags and the DCT algorithm used. This is especially true if your Raspberry Pi is decoding jpeg streams 24/7, such as from an surveillance camera.
By default, Libjpeg uses the more accurate integer method (JDCT_ISLOW) at the DCT step of decoding a jpeg file. Looking at the blue bars, we can see a clear trend of the performance increase from -O2 to -Os to -O3, though marginally. It will probably matter if Libjpeg is continuously decoding jpeg streams.
This trend is, however, broken when Libjpeg is using JDCT_IFAST and JDCT_FLOAT methods, which leads to the next topic of discussion.
DCT Method: [JDCT_IFAST is winner]
Using the less accurate integer method (JDCT_IFAST) clearly produces the fastest decoding speed as seen with the green bars. The JDCT_IFAST method leads by the widest margin vesus the other two methods.
The JDCT_FLOAT method does not seem to produce very fast decoding speed except when Libjpeg is compiled with -O2 flag. Using the hardware VFP floating-point coprocessor with -O2 flag result in decoding speed that matches the improvement from the GCC -O3 flag.
The -Os Flag: [Not in consideration]
This GCC flag produce binary that is optimized for size. It is commonly seen as -O2 optimizations without sacrificing for binary file size, so the GCC compiler will create binary of smaller size. In this case, where we want Libjpeg binary to decode faster, this GCC flag is useless.
The VFP hardware floating-point coprocessor: [Maybe]
The Raspberry Pi's BCM2835 SoC contains the VFPv2 coprocessor unit which is quite rare with chip based on ARMv6 instruction set. It is not very powerful, but may help in certain computations. With Libjpeg decoding, this coprocessor only make sense when the Libjpeg binary is compiled with -O2 flag.
Conclusion
If decoding speed is all that matters, then go with fast integer DCT method. However, do note that this method may produce corrupted jpeg images. Test on your own setup to verify.
If fast integer DCT method is not working well for you, then you have two options, either go with the default DCT method and compile Libjpeg with -O3 flag, or choose floating point DCT method with -O2 optimization.
I have PIL installed via pip. I have libjpeg installed via homebrew. I have the system python.
I was having problems with PIL's jpeg module. It was giving the error message: "ImportError: The _imaging C module is not installed". It was installed, but it was broken. Telling python to import _imaging gave me the better message: "Symbol not found: _jpeg_resync_to_restart".
So I had a look: dyldinfo -dylibs /Library/Python/2.7/site-packages/PIL/_imaging.so and saw this:
for arch i386: attributes dependent dylibs /usr/lib/libz.1.dylib /usr/lib/libSystem.B.dylib for arch x86_64: attributes dependent dylibs /usr/local/lib/libjpeg.8.dylib /usr/lib/libz.1.dylib /usr/lib/libSystem.B.dylib
So the i386 architecture has no libjpeg. Fix thusly:
sudo pip uninstall PIL
brew remove jpeg
brew install --universal jpeg # NOTE the "--universal" flag
sudo pip install PIL
Afterward, if you run dyldinfo -dylibs /Library/Python/2.7/site-packages/PIL/_imaging.so you'll see:
for arch i386: attributes dependent dylibs /usr/local/lib/libjpeg.8.dylib /usr/lib/libz.1.dylib /usr/lib/libSystem.B.dylib for arch x86_64: attributes dependent dylibs /usr/local/lib/libjpeg.8.dylib /usr/lib/libz.1.dylib /usr/lib/libSystem.B.dylib
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming