top | item 6958913

(no title)

jbri | 12 years ago

Given that these techniques seem to be well-known, it would be interesting to see a JPEG compressor which uses what we know of human vision to minimize filesize while keeping the image visually the same.

JPEGmini seems to go partway with selective compression, but it seems like there's room to improve the actual compression algorithm to do things like gaussian smoothing instead of just truncating the high-frequency components to reduce filesize.

discuss

order

jacobolus|12 years ago

Well the whole point of a compression scheme like JPEG is to use what we know about human vision to minimize file size while not visually changing anything.

But JPEG is a pretty crude algorithm designed mainly to be computationally cheap [to match the capabilities of computer hardware in 1992 when it was created]. Trying to make better encoders within the limits of what JPEG decoders can handle is quite limiting, and yields only marginal improvements.

It’s possible to do much better if we’re willing to accept more CPU time spent in encoding/decoding using fancier algorithms. Unfortunately it’s really hard to get traction for anything else, because the whole world already has JPEG decoders built into everything. For instance JPEG 2000, designed to be a general purpose replacement with many improvements over JPEG, is now 13 years old but used only in niche applications, such as archiving very high resolution images.

But for use cases where you control the full stack, better compression is quite viable. Video game engines for instance devote considerable attention to image compression formats.

pornel|12 years ago

I'm trying to write a better JPEG compressor: https://github.com/pornel/jpeg-compressor

IMHO JPEG algorithm isn't crude. IMHO it's actually quite brilliant—simple and very closely tied to human perception. The core concept of DCT quantization hasn't been beaten yet—even latest video codecs use it, just with tweaks on top like block prediction and better entropy coding.

Wavelet compressors like JPEG 2000 beat JPEG only in lowest quality range where JPEG doesn't even try to compete. Wavelets seem great, because their blurring gives them high PSNR, but lack of texture and softened edges make them lose in human judgement.

nova|12 years ago

> Unfortunately it’s really hard to get traction for anything else, because the whole world already has JPEG decoders built into everything.

Patents don't help either.

xfs|12 years ago

uses what we know of human vision to minimize filesize while keeping the image visually the same.

This is what JPEGmini is doing, perceptual compression metric.

gaussian smoothing instead of just truncating the high-frequency components

Gaussian smoothing does remove high-frequency components.