Comment by magicalhippo
5 years ago
> I expected to have to do gamma correction when making a gradient recently, but in the end it looked like I didn't have to
If you don't explicitly specify the color space you're working in, then you're using some implicitly defined color space in which case you basically need to know what that is (at least roughly).
So traditionally in Windows, way back, when you created a bitmap, wrote some data to it and then drew it, there was no explicit mention of a color space. Instead it was implicit, and it was de-facto non-linear.
These days you can specify[1][2] the color space you're working in, and Windows will then transform the colors into the specified device color space. So then you can specify if you want to work in linear RGB space or say non-linear sRGB.
Unity has something similar[3], which affects how you write shaders, how your textures should be saved etc.
[1]: https://docs.microsoft.com/en-us/previous-versions/windows/d...
[2]: https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf...
[3]: https://docs.unity3d.com/Manual/LinearRendering-LinearOrGamm...
Yes, and in almost all of these discussions, the implicit color space is (non-linear) sRGB. (IIRC Macs might have used a different default color space one-two decades ago ?)
Also, I'm on Linux, and doing picture manipulation with Octave, but thank you for the links anyway !
Yeah I was just using Windows because that's what I was familiar with. I guess on Linux is can vary a lot more on the setup.
So yeah for Octave you need to know what Octave does with the data afterwards. If it's saving a matrix to a PNG say, it could assume the matrix is linear and convert to sRGB which would be a good choice if it also supported say OpenEXR files. However it could also just take the values raw, assuming you'd convert the data to sRGB before saving. Or even allow you to specify the color space in the iCCP chunk, which would give you more power.
Again, what it actually does is something that needs to be looked up.
Yeah, since we're learning, we're not doing anything fancy on that side (at least yet), so (so far) working with sRGB bmp/png/jpg input and sRGB bmp output.