Reputation: 2712
What kind of RGB color space is used by Matplotlib? I am especially interested, whether it is sRGB.
RGB and RGBA are sequences of, respectively, 3 or 4 floats in the range 0-1.
Upvotes: 5
Views: 1747
Reputation: 4070
Matplotlib is at the time of this writing not colour managed so the current working RGB colourspace will be whatever you have chosen to encode your RGB values, e.g. ACES2065-1, BT.2020, ProPhoto RGB or most likely sRGB. Keep in mind though that some resources, e.g. Viridis, were created with sRGB as a working space in mind.
Upvotes: 2
Reputation: 9523
sRGB is the default colour space of PC computers (and for Web). So you can assume that space. On the other hand, there is no hard written specification. Matlab uses mostly numbers, so it is up to you how to interpret the numbers. Not different of solving equation where you (implicitly) have the units.
If you handle colour in a precise way (e.g. transforming data from a colour space to an other), usually you must specify the two spaces.
If you want to save an image not in sRGB, you should specify the colour space (ICC headers). Do no expect you or other people could see the image correctly (if it happens, they could not navigate internet with photo with real colours).
On graphs, "red" is red independently of (most common colour space). It could have a different shade, but usually it doesn't matter (if it is consistent with legend).
Note: in reality you never have sRGB on inputs and outputs, but it is a good approximation for most of people.
Upvotes: 1