-
Notifications
You must be signed in to change notification settings - Fork 0
X04 Standard RGB Primaries
Color spaces are a fundamental concept in the field of computer graphics and image processing. They are used to represent and manipulate colors in a standardized way, allowing for consistent and accurate color reproduction across different devices and platforms. Color spaces also play an important role in wide range of color management applications and solutions. By using standardized color spaces, color management systems can ensure that colors are reproduced consistently, even when displayed on different monitors or printed on different media.
There are several types of color spaces, each with their own specific characteristics and uses. One of the most commonly used color spaces is the RGB color space, which represents colors using three primary colors (red, green, and blue) and various shades and intensities of each.
One important aspect of RGB color spaces is the range of colors that can be represented. Since RGB displays work by combining different wavelengths of light, it is possible to represent a wide range of colors, including those that are not available in other color models. However, it is important to note that RGB color spaces have some limitations. For example, they are not well-suited for representing colors that are not available in the RGB color gamut. Additionally, RGB color spaces do not account for the way that colors are perceived by the human eye, which can lead to color distortion and other issues. These limitations are founded in so-called RGB primaries, being the triangular range on which specific RGB model is based in color space.
Typically, RGB primaries consist of chromaticity coordinates for maximal red, green and blue measures, as well as chromaticity coordinates of referencial white point. Other than that, RGB profiles also should have information about standarized gamma (as well as ways of how gamma compands output, which can be profile-specific). The chromaticity coordinates of the RGB primaries depend on the specific definition of the primaries. In the standard RGB model, the primaries are defined as the points on the color wheel that correspond to the maximum values of the red, green, and blue curves on a graph of luminance (brightness) versus hue (color).
The following table contains the list of standard RGB primaries available through \tei187\ColorTools\Dictionaries\RGBPrimaries\Standard\Primaries
namespace or loadable through appropriate dictionary.
Full name | Illuminant | Class name | Custom identifiers |
---|---|---|---|
Adobe RGB 1998 | D65 | AdobeRGB1998 | adobe, adobe1998 |
Apple RGB | D65 | AppleRGB | apple |
Best RGB | D50 | BestRGB | best |
Beta RGB | D50 | BetaRGB | beta |
Bruce RGB | D65 | BruceRGB | bruce |
CIE RGB | E | CIERGB | cie |
ColorMatch RGB | D50 | ColorMatchRGB | colormatch, color-match |
Don RGB 4 | D50 | DonRGB4 | don4, don |
ECI RGB v2 | D50 | ECIRGBv2 | eci, eciv2 |
Ekta Space PS5 | D50 | EktaSpacePS5 | ektaspace, ekta-space, ps5 |
NTSC RGB | C | NTSCRGB | ntsc |
PAL/SECAM RGB | D65 | PALSECAMRGB | palsecam, pal-secam, pal/secam |
ProPhoto RGB | D50 | ProPhotoRGB | prophoto, pro-photo |
Radiance RGB | E | RadianceRGB | radiance |
SMPTE-C RGB | D65 | SMPTECRGB | smptec, smpte-c |
sRGB | D65 | sRGB | rgb |
Wide Gamut RGB | D50 | WideGamutRGB | widegamut, wide-gamut |
It is also possible to create an object for custom set of primaries, using tei187\ColorTools\Conversion\RGBPrimaries\Custom
class namespace.
Constructor requires 4 arguments, in order:
- array of arrays with xyY transcription for each channel (R, G, B),
- name for the primaries (can be blank),
- illuminant white point - either a standard illuminant name as string or specific XYZ tristimulus array. If string is passed and does not correspond to any illuminant available, replaced with D65,
- gamma float. By default 2.2. Custom primaries can use only linear gamma companding.
use tei187\ColorTools\Conversion\RGBPrimaries\Custom as CustomPrimaries;
$newPrimaries = new CustomPrimaries(
[ 'R' => [ .7347, .2653, .228457 ],
'G' => [ .215, .775, .737352 ],
'B' => [ .13, .035, .034191 ] ],
'Custom Primaries Set',
'D55',
2.1
);
var_dump($newPrimaries->getPrimariesName(), // string(20) "Custom Primaries Set"
$newPrimaries->getIlluminantName(), // string(3) "D55"
$newPrimaries->getGamma()); // float(2.1)