186 points · by tosh · 7y ago · 123 comments
Overall, it is a very complex landscape.
What does this mean? Do you have a citation to a source explaining whatever this is trying to say using precise standard color science terminology?
I am curious what this referred to, because I have never heard such a thing, and it doesn’t match my understanding of human color vision, a subject which I have studied fairly extensively. It was stated authoritatively, without any elaboration or evidence.
I am asking for a citation so I can understand in more careful technical terms what claim is being made.
(P.S. Having site moderators step in to discourage basic good-faith questions is a bad show.)
https://ai.google/research/people/105344
https://scholar.google.com/citations?user=SnJNeR4AAAAJ&hl=en
Literally a world expert on the topic.
And if you must use HEVC-based imaging, consider HEIF which has considerable support.
1. The AVIF encoder I was using[0] is based off libaom, which means a 1080p image takes almost 30 seconds to encode. rav1e is supposedly much faster, so I wonder how well it would do for AVIF.
2. Almost no viewer or browser support, and what does is usually some kind of beta or preview. (VLC nightly, Windows 10 AV1 plugin[1])
[0] https://github.com/Kagami/go-avif
[1] https://www.microsoft.com/en-us/p/av1-video-extension-beta/9...
For browser support it should be possible to implement a poly-fill similar to https://github.com/UprootLabs/poly-flif which renders images in the FLIF format (https://flif.info/) into canvas elements.
FLIF as a format might be worth looking at while you are reviewing the area.
https://github.com/Kagami/avif.js
I'd rather keep it simple and not deal with more JS, and I'm OK with using JPEG for now. (I've been using mozJPEG for years)
As you mention, rav1e would help, but HEVC/HEIF is only acceptable in speed due to hardware support.
AV1 is slowly making its way into silicon, though. I'm personally interested in seeing this make its way into cameras - even when I shoot in RAW, I often just use the off-camera JPG. I'd love for that to be AVIF instead.
For that reason I'd say that if you can license HEVC, use BPG, not HEIF. And I'd love to have an AV1-based BPG version.
This is untrue. While anything written by a working group that isn't trying to get to the moon with a below-average calculator will be more complicated than necessary, it is not a kitchen sink.
Both AVIF and HEIF store just a sequence of images with metadata (EXIF, depth maps, animation frame timings, profiles, ...). It's comprehensive, sure, but not a kitchen sink.
The AVIF spec is quite readable: https://aomediacodec.github.io/av1-avif/
> The reference implementation is a ton of C++ code I would not dare to use in a security-sensitive application.
You shouldn't be concerned because the implementation is big—you should be concerned because it is of non-zero length and parsing wild data. You need a safe port regardless if you're going to play the security sensitive card. BGP being C is an equal liability.
I don't want neither BGP nor HEIF to become popular at the cost of AVIF due to being based on HEVC, but I see no significant differentiation between them—HEIF is already established and does the trick.
http://xooyoozoo.github.io/yolo-octo-bugfixes/#swallowtail&j...
Or here:
https://bellard.org/bpg/lena.html
The difference between webp from the first link is actually quite small (http://xooyoozoo.github.io/yolo-octo-bugfixes/#swallowtail&w...).
Additionally you can find the Javascript decoder here:
https://github.com/xingmarc/bpg-decoder
It's 215k of Javascript though so isn't really that practical in most cases and I'd worry about how it was affecting battery life. It'd be very interesting to do some tests and see.
I don't know that this qualifies as unbelievable. This is just good marketing and spin. The image in that link is exploiting the fact that modern codecs specify upsampling filters, so the HEVC half looks smoothly varying while JPEG can, per spec, only look pixelated when blown up like that.
There's absolutely no reason that thing couldn't have shown you a jpeg image rendered with bilinear filtering, which of course is what you'll see if you put that JPEG on a texture and scale it up using the GPU.
But it didn't, because it wanted to convince you how much "unbelievably" better HEVC is. Meh.
I mean, to be clear: HEVC is absolutely better, to the tune of almost a factor of two in byte size for the same subjective quality. Just not like this. If you've got a site where still images are a significant fraction of your bandwidth budget (and your bandwidth budget is a significant fraction of your budget budget) then this could help you. In practice... static content bandwidth is mostly a solved problem and no one cares, which is why we aren't using BPG.
That’s not true, this particular JPEG will not look smooth on a GPU. The visible blocks are 8x8 pixels, not 1 pixel. The blocks would still be blocky because the compression has reduced them to only the DC component. This means the JPEG decode would still decode large blocks into texture memory and the GPU would still render large blocks with a slight blur between the 1 pixel borders of the 8 pixel blocks.
> In practice... static content bandwidth is a mostly solved problem and no one cares, which is why we aren’t using BPG.
I don’t believe that’s true either. I don’t know what you mean about bandwidth being “solved”, but more data is more data. If everyone could reduce their static images today by 2x without thinking, I’m pretty sure they would. I would on my sites if I could. The reason that BPG (or any other format!) isn’t yet being used is lack of browser support and tools and licensing and consensus, not because nobody cares about bandwidth. If what you said is true, then JPEG & PNG would never be replaced, but it’s already starting to happen.
And I'm sorry, but if that JPEG is showing artifacts like that it was simply miscompressed, likely deliberately. I repeat, there is absolutely no reason an image of there same byte count cannot look just fine on that screen. For goodness sake, just reduce the resolution if nothing else.
I think you're focusing on the background? I agree that they should have masked the background out, but if you look instead at the first yellow segment of the rear wing near the body, there is clearly more available detail in the HEVC side.
There are three benefits that one could get from reducing the file size:
1. Reduced storage cost
2. Reduced bandwidth cost
3. Better user experience
In my models, storage cost matters a lot. You can't come out ahead here, however, if you still have to keep JPEG copies of all the images.
Benefits in terms of 2 are real.
Benefits in terms of 3 are hard to realize. Part of it is that adding any more parts to the system will cause problems for somebody somewhere. For instance, you can decompress a new image format with a Javascript polyfill, but is download+decompress really going to be faster for all users?
Another problem is that much of the source material is already overcompressed JPEG so simply recompressing it with another format doesn't lead to a really improved experience. When I've done my own trials, and when I've looked closely at other people's trials, I don't see a revolutionary improvement.
A scenario that I am interested in now is making desktop backgrounds from (often overcompressed) photos I find on the web. In these cases, JPEG artifacts look like hell when images are blown up, particularly when images have the sharp-cornered bokeh that you get when people take pictures with the kit lens. In that case I can accept a slow and expensive process to blow the image up and make a PNG, something like
https://www.mathworks.com/help/images/jpeg-image-deblocking-...
or
https://github.com/nagadomi/waifu2x
The other approach I imagine is some kind of maximum entropy approach that minimizes the blocking artifacts.
I'm not saying BPG isn't better, I'm saying that link is ridiculous and doesn't capture the much more modest gains that it actually offers.
Nonetheless, the BPG format is a super-incredible hack.
I've been planning to write an adversarial neural network based JPEG decoder that would find the most realistic possible image that would get compressed to the given JPEG... I would love to have such a decoder integrated into browsers!
There are many, but mostly focused on output quality, and slow, and written in matlab using fancy tools.
If somebody submits a simple patch (written in pure C without dependences) to the jpeg reference distribution, and the code is very fast and good enough, it will most surely become mainstream. The thing is, that the people who know enough math to create a good jpeg decompressor do not tend to be well-versed nor interested in C programming.
https://blog.cloudflare.com/parallel-streaming-of-progressiv...
For realistic scenarios, you can't use compression that makes faces look airbrushed, makes wood and hair look like a plastic imitation, etc. If your designers/marketers/photographers care about "grain" in photos, they'll hate you for applying benchmark-winning aggressive smoothing and deringing.
Note that when you switch the benchmark file size to "Medium", the difference is not that big. On "Large" all codecs, except some pathological cases, are nearly identical.
And that makes JPEG stay, despite all newer codecs being "unbelievably" better. Everything newer than JPEG can smooth out blocking artifacts, but quality levels useful for still images don't exhibit blocking in the first place.
The x265 team has repeatedly attempted to refute this claim, but it’s a lot of throwing numbers and lots of mud back and forth between the different implementors. Do you have anything solid to back that statement?
My point is not that x265 isn't "good" in absolute terms, it just isn't x264 level insanely good. In AVC era, x264 was absolutely amazing in the details. And just to point out, comparing encoder is hard and depends a lot on materials and target bitrate.
[1] https://www.streamingmedia.com/Articles/Post/Blog/HEVC-IP-Ow...
https://en.wikipedia.org/wiki/AV1#AV1_Image_File_Format_(AVI...
still waiting on the software support.
Saving some bytes is nice, but when people are streaming videos and audio, shaving off a few bytes isn't worth the endless lawsuits.
Better yet, it's probably the most-likely technology to be accepted into the upcoming JPEG XL standard!
i.e.: why doesn't Chrome support AVIF? Is it because it competes with their own invented-here WebP?
It seems like adding new image codecs for given content types would be pretty trivial if the libraries are available and stable and license compatible; why be conservative and not just support the newish ones to help the best ones gain traction?
It seems like browser vendors are just dragging their feet.
Webp now is supported by pretty much every browser, but a lot of image viewers don't support the format yet. There has to be a certain amount of momentum to justify supporting a new image format.
2. Bloat
3. You can't really stop supporting media formats. Once you put anything into a browser, you can't take it out. The best that can be done is depreciate it forever.
I wonder how they compare.
(Don't take my word for that, I'm no expert on the subject)
BPG meet GIF, GIF meet BPG. The most annoying thing about GIF in the early days were the damn Compuserve patents that they would go out of their way to hassle you with if they thought they could.
> Current research works on designing and developing more energy-efficient BPG hardware which can then be integrated in portable devices such as digital cameras.
I guess it doesn't really matter that much, but I'm still curious.