logoalt Hacker News

JPEG Compression

171 pointsby vinhnxlast Saturday at 1:31 AM31 commentsview on HN

Comments

chromakodetoday at 8:43 AM

The DCT is a cool primitive. By extracting the low frequency coefficients, you can get a compact blurry representation of an image. This is used by preload thumbnail algorithms like blurhash and thumbhash. It's also used by some image watermarking techniques to target changes to a detail level that will be less affected by scaling or re-encoding.

I made a notebook a few years back which lets you play with / filter the DCT coefficients of an image: https://observablehq.com/d/167d8f3368a6d602

danwillstoday at 8:20 AM

Having played a bit with Discrete FFT (with FFTW on 2D images in a Shake plugin we made at work ages ago) makes the DCT coefficients make so much more sense! I really wonder whether the frequency-decomposition could happen at multiple scale levels though? Sounds slightly like wavelets and maybe that's how jpeg2000 works?.. Yeah I looked it up, uses DWT so it kinda sounds like it! Shame it hasn't taken off so far!? Or maybe there's an even better way?

show 1 reply
bambaxtoday at 8:23 AM

So the idea behind JPEG is the same as behind MP3: we filter out what we don't perceive.

I wonder if other species would look at our images or listen to our sounds and register with horror all the gaping holes everywhere.

show 4 replies
meindnochtoday at 8:49 AM

What would happen if the Cr and Cb channels used different chroma subsampling patterns? E.g. Cr would use the 4:2:0 pattern, and Cb would use the 4:1:1 pattern.

tmilardtoday at 8:36 AM

Thanks for the sharing : I now understood more how sampling of image works. And going from RGB to lunimesence+chroma works. interesting and usefull

NooneAtAll3today at 7:46 AM

> Application error: a client-side exception has occurred (see the browser console for more information).

seems like website doesn't work without webgl enabled... why?

show 2 replies
jbverschoortoday at 7:39 AM

Application error: a client-side exception has occurred (see the browser console for more information).

7777777philtoday at 7:26 AM

Already posted here earlier: https://news.ycombinator.com/item?id=47376119

show 1 reply
tomalacitoday at 7:45 AM

I usually have a script/alias cmd to automatically convert images to webp. The webp format has pretty much replaced jpg/jpeg (lacks transparency/alpha support) and png (no compression) formats for me.

There is also AVIF format which is newer and better but it needs to still mature a bit with better support/compatability.

If you are hosting images it is nice to use avif and fallback to webp.

show 4 replies