If browsers supported APIs to allow "native" image/video/audio codecs to be written in JS, we could support new formats like this without needing any co-operation from the (very conservative) browser vendors. I wrote a proposal for this here: https://discourse.wicg.io/t/custom-image-audio-video-codec-a...
Seems like a good way to get a bazillion new formats that we won't be able to read anymore in 5 years.
FLIF – Free Lossless Image Format
51–60 of 153 posts
Re: FLIF – Free Lossless Image Format
#52If browsers supported APIs to allow "native" image/video/audio codecs to be written in JS, we could support new formats like this without needing any co-operation from the (very conservative) browser vendors. I wrote a proposal for this here: https://discourse.wicg.io/t/custom-image-audio-video-codec-a...
I assume that is how https://uprootlabs.github.io/poly-flif/ is adding support. I might have to have a browse around that project's code when I have some free time.
I doubt it would be practical for production use, but you never know...
Re: FLIF – Free Lossless Image Format
#53One critical sidenode: it seems FLIF is still not as good as JPEG when used as lossy compression (this is something the benchmarks do not show well).
For example, go to http://uprootlabs.github.io/poly-flif/, choose the monkey image, choose 'comparing with same size JPG', and set truncation to 60% or more.
Also, I'm not sure how efficient en- and decoding is for FLIF.
Re: FLIF – Free Lossless Image Format
#54Re: FLIF – Free Lossless Image Format
#55Re: FLIF – Free Lossless Image Format
#56Does anybody understand how lossless JPEG works? To my mind, the whole point of JPEG is to get rid of high-frequency components.
Likewise you can turn any lossless compressor into a lossy one, by modifying the pixels that are the hardest to compress. E.g. if there is a random red pixel in a group of blue pixels, you can make it blue, and save up to 3 bytes. Or you can discard color information that humans aren't very sensitive too anyway, like JPEG does. All lossless means is that the compression isn't required by the format itself.
Re: FLIF – Free Lossless Image Format
#57Pretty amazing! Particularly nice is that an alpha channel and animation are also possible. One critical sidenode: it seems FLIF is still not as good as JPEG when used as lossy compression (this is something the benchmarks do not show well). For example, go to http://uprootlabs.github.io/poly-flif/ , choose the monkey image, choose 'comparing with same size JPG', and set truncation to 60% or more. Also, I'm not sure…
If the image quality of the 60% truncated jpeg is acceptable then you can get the same quality but half the size using FLIF at 80%.
Re: FLIF – Free Lossless Image Format
#58Earlier quoted context omitted.
Seems like a good way to get a bazillion new formats that we won't be able to read anymore in 5 years.
But that's another advantage. Each image would have to be distributed alongside it's javascript decoder. Even if the format is abandoned, the decoder will still be there, and it will still work on that webpage.
Re: FLIF – Free Lossless Image Format
#59Re: FLIF – Free Lossless Image Format
#60I wonder if IE will adopt it? Firefox and Chrome are very responsive, Microsoft not so much.
Safari is much bigger problem than Edge/IE. No hope for WebM in Safari. WebM for Edge is in development.