Hacker News new | ask | show | jobs
by martin_a 365 days ago
Sorry, but that sounds more like a problem with your color management systems and workflows and not so much with JPEG itself.
1 comments

JPEGs are intrinsically YCbCr not RGB, so I don't know how you would avoid some precision loss when you combine that colorspace conversion with things like the quality level and (potentially) subsampling.
Are they? I thought JPG could switch? I know jpegli uses XYB colorspace in JPGs.
JPEG can be YCbCr, RGB or even CMYK (usually from Photoshop or similar software). There can also be unusual subsample ratios for YCbCr, such as 4:2:1. I created some WASM Go bindings for jpegli, and I recall that such images cannot be represented in Go; therefore, for these images, I force RGBA output.

Also, XYB is an option; I use the adaptive quantisation option from jpegli (with progressive level 2) to get smaller files. I never bothered with XYB, as it looked complicated.