Graphics::ColorObject

Graphics::ColorObject can convert between color spaces.
Download

Graphics::ColorObject Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Alex Izvorski
  • Publisher web site:

Graphics::ColorObject Tags


Graphics::ColorObject Description

Graphics::ColorObject can convert between color spaces. Graphics::ColorObject can convert between color spaces.SYNOPSIS use Graphics::ColorObject; # rgb to hsv $color = Graphics::ColorObject->new_RGB(); ($h, $s, $v) = @{ $color->as_HSV() }; # one rgb space to another (NTSC to PAL) $color = Graphics::ColorObject->new_RGB(, space=>'NTSC'); ($r, $g, $b) = @{ $color->as_RGB(space=>'PAL') };ABSTRACTUse this module to convert between all the common color spaces. As a pure Perl module, it is not very fast, and so it you want to convert entire images quickly, this is probably not what you want. The emphasis is on completeness and accurate conversion.Supported color spaces are: RGB (including sRGB, Apple, Adobe, CIE Rec 601, CIE Rec 709, CIE ITU, and about a dozen other RGB spaces), CMY, CMYK, HSL, HSV, XYZ, xyY, Lab, LCHab, Luv, LCHuv, YPbPr, YCbCr, YUV, YIQ, PhotoYCC.Conversion between different RGB working spaces, and between different white-points, is fully supported.For any supported color space XXX, there is one constructor new_XXX that creates a color using data in that color space, and one method as_XXX that returns the current color as expressed in that color space. For example, for RGB there is new_RGB and as_RGB. The color data is always passed as an array reference to a three-element array (four-element in the case of CMYK). Thus, to convert from RGB to HSL, you can use: $color = Graphics::ColorObject->new_RGB(); ($h, $s, $l) = @{ $color->as_HSL() };The constructor can always take a hash of optional arguments in addition to the color value, namely the working RGB space and the white point. For example: $color = Graphics::ColorObject->new_RGB(, space=>'Adobe', white_point=>'D65');For a list of all supported color spaces, call Graphics::ColorObject->list_colorspaces(). For a list of all RGB working spaces and of all white points that this module supports, call Graphics::ColorObject->list_rgb_spaces() and Graphics::ColorObject->list_white_points().If not specified, the working RGB space will be sRGB. Many non-RGB conversions also rely on an implicit RGB space, and passing an RGB space as an option (either to the constructor or later) will have an effect on the values. Requirements: · Perl


Graphics::ColorObject Related Software