3 ms·
Briefly and massively simplifying: Unless otherwise specified, sRGB is the default storage and display colorspace for most digital applications dealing with RGB
by fsloth 11y ago
Briefly and massively simplifying: Unless otherwise specified, sRGB is the default storage and display colorspace for most digital applications dealing with RGB image data (excluding video)
https://en.wikipedia.org/wiki/SRGB https://en.wikipedia.org/wiki/SRGB
However, one cannot do computations on an image in sRGB colorspace since the colorspace is not linear - the values will turn out wrong. I.e. imaging algorithms expect source data to be in linear colorspace, and if fed sRGB data the result will turn out more or less wrong.
Thus, when doing any weighting calculations etc. on a set of samples the samples must be in linear (e.g. RGB) colorspace.
Your OpenGL implementation may or may not handle this automatically for you if you specify the image to be in one of the sRGB texture formats.
https://www.opengl.org/registry/specs/EXT/texture_sRGB.txt https://www.opengl.org/registry/specs/EXT/texture_sRGB.txt
So, in the general sense, if doing any handcoded imaging routines, and reading e.g. PNG image, one needs to convert it to linear colorspace before processing, and back to sRGB before writing to disk/displaying.