JPG subsampling (chroma subsampling)

last modified on 30 July 2019, by Cédric Louvrier

pingo could try to set the chroma subsampling during the JPG encoding. this lossy setting affect chrominance from image data

N: from 0 to 2 — 0: 1x1,1x1,1x1 (4:4:4)1: 2x1,1x1,1x1 (4:2:2)2: 2x2,1x1,1x1 (4:2:0)
pingo -jpgsample=N target
original file: rvb.png chroma subsampling
-jpgsample=0 (default) -jpgsample=2
rvb - sample 0 rvb - sample 2
47.44 KB (quality 100) 33.38 KB (quality 100)
1x1,1x1,1x1 (4:4:4) 2x2,1x1,1x1 (4:2:0)

auto subsampling

pingo should not do upsampling even if you set it. it should detect and set the subsampling and quality factors automatically. the following sample is 4:2:0, with a quality factor of 60. in this case, pingo should not process the image data

original file: station-sample2-q60.jpg automatically skip image processing
original -auto
station - sample 2 q60 station - sample 2 (not processed)
52.72 KB (quality 60, 2x2,1x1,1x1 (4:2:0)) skipped (image data not processed)

no upsampling

if the quality factor is high but image data is 4:2:0, it should not do upsampling. it could reduce the quality factor by keeping the original chroma subsampling (even if you set specifically -jpgsample=N, where N could be 0 or 1)

original file: station-sample2-q95.jpg automatically set the chroma subsampling
original -auto
station - sample 2 q95 station - sample 2 (auto)
414.94 KB (quality 95, 2x2,1x1,1x1 (4:2:0)) 216.91 KB (quality auto, 2x2,1x1,1x1 (4:2:0))