Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, it has to be injective from the real world to the file format. It doesn't have to be bijective.

> As soon as you manipulate values of your image in your color space, you run the risk of falling outside the color domain.

If your manipulation could go outside the domain, then your manipulation is incorrect. Like, if I have a number from 0 to 99 that I store in a byte, it's fine that a byte is not bijective to those numbers, and if I end up with a byte representing 105, then I did something wrong that corrupted my byte.

If I'm doing incorrect math, a bijective color space doesn't fix the problem, it just guarantees that I get an incorrect color out the other end instead of possibly getting an incorrect color or possibly getting an error value.



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's not bijective to all sequences of bytes but that's fine. No correct manipulation will give you a sequence that can't decode.

If you're trying to do incorrect math, you've already lost, and no color space will help. For example, overflowing your red channel in sRGB could turn your eggshell into a cyan.

> and trying to stay percepetually uniform

Where did that come from?

Zero encodings will be perceptually uniform, therefore being non-uniform isn't a disqualifier.


Right, IIRC it's the "work" color spaces that are trying to go for perceptual uniformity, not the "storage" ones ?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: