What is a color space (sRGB)?
A color space defines how numeric color values map to actual colors, and sRGB is the standard default color space of the web and most screens.
By Rocco Bombardieri · Updated
Explained in more detail
A set of numbers like (200, 120, 40) does not describe a color until you say what the numbers mean. The color space supplies that meaning: which red, green and blue primaries are used, what the white point is, and how values relate to brightness.
sRGB is the default. It was created by HP and Microsoft in the 1990s and standardized as IEC 61966-2-1. The original W3C proposal said that web content, and images with no embedded profile, should be assumed to be in sRGB, and CSS color functions such as rgb() and hsl() are defined in sRGB. Treat an untagged image as sRGB.
Wider spaces exist. Display P3 covers a larger range of saturated colors, and modern browsers can work with it, for example through the CSS color() function and the canvas colorSpace option. Adobe RGB is another wide space. A file can embed an ICC profile that declares its space (PNG has an iCCP chunk for this, and an sRGB chunk to declare sRGB), so software can convert its colors correctly.
Problems arise when a profile is lost or ignored. A wide-gamut image whose profile is stripped is typically read as sRGB and can look flat and desaturated. For this reason, exports meant for the web are commonly converted to sRGB, which is the safest common denominator.
Canvas output is a freshly encoded file, so do not assume an embedded profile from the source survives. For standard web graphics, sRGB is what you want. For wide-gamut photography, check the result.