Earlier quoted context omitted.
The point is that the average human ""real" color space" has a very weird shape : https://upload.wikimedia.org/wikipedia/commons/a/a9/Visible_... Good luck representing that with only 3 channels, without using "bytes representing 105" (aka imaginary colors), and trying to stay percepetually uniform ! It gets even worse : the real color space is non-Euclidean : it stretches out, parallel lines drift further apart, etc…
> without using "bytes representing 105" (aka imaginary colors) I think you misunderstood my point. I'm saying it doesn't matter if certain byte sequences are invalid and don't correlate to real colors. Imagine you're encoding two digit numbers into bytes. It's not bijective but that's fine, no correct two-digit math will give you an invalid byte. Or imagine you're encoding numbers into bytes the way UTF-8 works. It'…
QOI: Lossless Image Compression in O(n) Time
271–280 of 303 posts
Re: QOI: Lossless Image Compression in O(n) Time
#272Earlier quoted context omitted.
The difference will be painfully clear once you try to walk a junior developer through installing and linking new files to a large project in Visual Studio, vs "copy this .h file here and include it". Whether or not a "good build system" should handle it, the fact that single-file libraries are much preferred these days should demonstrate most people don't have such a build system
So much of the C/C++ ecosystem revolves around knowing your build tools that, for most intents and purposes, it should honestly be considered an integral part of the languages. If I ever teach an introductory C/C++ course, I would dedicate at least 1/4 of my time to explaining: * What a translation unit is, and how compiling a translation unit to an object file works * What a linker is, and how the linker combines ob…
Re: QOI: Lossless Image Compression in O(n) Time
#273Do you have benchmarks on what it does in the worst case? Let's say a 1000x1000 pixels image of RGB noise?
The bitmap should be 24 bit * 1Mpixels = 3MB. What's the size, compressed as PNG, and compressed as QOI?
Re: QOI: Lossless Image Compression in O(n) Time
#274Earlier quoted context omitted.
What are you comparing it with? If you compare Rec.2020 with 10 bits per channel and sRGB at 9.5 bits per channel, both of them using the same peak brightness, you should see similar amounts of banding on both. Increasing the maximum brightness can require a lot of extra bits to keep things smooth, but that's a separate thing from which colors are possible.
Ah, I see your point, but I still don't understand this argument, because in practice not only we want extra brightness in colours around the usual white points, but also we need the extra potential physical brightness to extend the colour space itself in terms of "colours only" (not sure that this even makes sense ?) because of the differing needs of different colours. (I'd assume that this is especially relevant fo…
Rec.709 has 10 and 12 bit modes too, and it needs them, even though it has the same gamut as sRGB.
The reason 10 bits isn't enough for Rec.2020 is because 10 bits was never enough to fully represent any gamut. Once you add enough bits to properly support a gamut, then extending it to match human vision is a tiny cost.
And to be extra clear, when I initially said "The difference between all visible colors and a more constrained color space", I was talking about taking a color space and expanding its gamut without changing anything else about it.
Re: QOI: Lossless Image Compression in O(n) Time
#275Earlier quoted context omitted.
The sRGB color #ffffff should never mean "the brightest white on this monitor", unless you're using an average CRT. Just imagine you're using an HDR display, where the brightest white is as bright as the sun.
OK but then when will you use that "bright as sun" color? If not, why provide them? If so, what color will you use ?
Re: QOI: Lossless Image Compression in O(n) Time
#276Lossless avoids all those issues around human perception. Also, if you're storing game assets, some of what you're storing as images is not really imagery. It may be normals or height fields, which lossy image compression messes up. The code is interesting, in that it iterates over the output array, not the input. This helps prevent write buffer overflows. It has read buffer overflows, though. You can craft a compres…
Re: QOI: Lossless Image Compression in O(n) Time
#277I know you don't like "design by committee" and overly complex formats. Also, the compression algorithm itself is somewhat independent of the "container format" that it's used with. However, if I may make a suggestion: If you do end up rolling your own container format for any reason, always include a way to store the colour space of the image! Treating RGB images as arrays of bytes without further tags is like treat…
Yes, also store the DPI. In general, allow arbitrary key-value pairs to be stored.
Color profiles however, yes, those are indeed important.
Re: QOI: Lossless Image Compression in O(n) Time
#278for a good simple and fast image compressor look at DXT (decoded natively by graphics cards). No benchmarks for encoder performance though.
Re: QOI: Lossless Image Compression in O(n) Time
#279Earlier quoted context omitted.
I think the author's intending to use this only as a data packing format (ex. for app/game development) and not a general-purpose exchange format. If all you want to do is pack image/texture data for your game then I totally get why they assume RGBA8 storage and leave out metadata such as color space information.
Right - this thread of people asking for colorspaces, dpi data, arbitrary metadata collections… all are exhibiting precisely the ‘expert group’ committee mindset that this format is supposed to avoid. If you want all that, there are formats galore that support it! The point is more: where are the formats for people who don’t need all that? Here is one. Please don’t try to ruin it.
The GPs advice about recording color space is spot on. Why design a new container when there are tons of ones off the shelf ones. The collection of files inside a Zip is my goto.
Re: QOI: Lossless Image Compression in O(n) Time
#280A+ for simplicity, readability, and security/code auditability!