JPEG scaling

cédric (dev) said on 01/24/2018

0.95f is now including a feature that scales huge JPG to prepare the image for Web. in this case, pingo will decrease the definition and adapt settings

edit 09/12/2018: new results — no more auto scaling

橘琥珀 said on 01/25/2018

What algorithm is used? Users may prefer other tools to scale their images. I feel that this feature is not an important part to the project, though.

cédric (dev) said on 09/12/2018

a late mention — since 0.97 (05/18/2018), pingo could scale JPG using -jpgscale in a very different way than before, that is faster and which offer better quality. instead of decoding and resampling the image data, the targeted spatial size should be retrieved directly from the DCT

pingo 0.95f vs 0.98.18
G1820 @ 2.7 Ghz - 2 Go RAM - Windows 7 32-bit
version image time definition bytes saved
- brook-org.jpg - 11658 x 6112 -
default option
0.95f 096-default.jpg 6.74s 11658 x 6112 -0.02 KB (negative!)
0.98.18 (same as original) 0.16s 11658 x 6112 (no savings)
resize function with same settings
0.95f 096-resize.jpg 2.96s 5829 x 3056 1228.44 KB
0.98.18 098-19-resize.jpg 2.09s 5829 x 3056 1250.61 KB

speed difference in default comes from the JPEG quality estimation which is done since 0.98.7: pingo should avoid the optimization because the input quality is lower than what it targets, so it should not wasting time in trials — 0.95f is writing JFIF so it creates a bigger output than original

if you compare the old and new scaling implementation by using the same settings, you could notice that the old is 1/2 only, while the new could target 1/2, 1/4 or 1/8. the process is faster while providing better perceptual quality and most of the time better savings

comment this