Hacker News new | ask | show | jobs
by ache7 2176 days ago
By the way, you can decode JPEG with less artifacts using these projects:

https://github.com/ilyakurdyukov/jpeg-quantsmooth (good for most mid-quality and high-quality images)

https://github.com/victorvde/jpeg2png (use for very low-quality images, slower)

jpeg-quantsmooth gives a sharper output (use "-q6" option).

jpeg2png output is a little blurry, but it does a better job of unblocking very low-quality images.

1 comments

ffmpeg/mplayer has some more principled smoothing filters than these (especially spp); they're made for MPEG4 but JPEG is pretty similar.

Another algorithm that should work but I haven't seen tried is edge-aware chroma upsampling. libjpeg uses nearest neighbor upscaling for the subsampled color planes, which is why JPEG looks so bad when there's a transition from eg saturated red to black.

Both of these projects have chroma upsampling.
All JPEG decoders have chroma upsampling. Here jpeg2png only seems to actually optimize it though; seems like it works but optimizing for "smoothness" could maybe be improved.

I'm suggesting something like eedi3 (http://avisynth.nl/index.php/Eedi3) but guided by the luma plane.

Oh, you can also jointly optimize the YUV-RGB conversion because if the pixel ends up out of range in RGB space it is probably a compression artifact. I read a paper on this once but haven't seen it implemented.

"All JPEG decoders have chroma upsampling."

Well, I meant better upsampling than bilinear interpolation, which blurs chroma.

"Oh, you can also jointly optimize the YUV-RGB conversion because if the pixel ends up out of range in RGB space it is probably a compression artifact."

Probably not, I suspect that the mozjpeg encoder may use this, so images with black on white text look better (artifact noise go beyond of range).