Name
colorspace — type of colorspace
Synopsis
$image->Set(colorspace=>string
)
$image->Get('colorspace')
Color reduction takes place in the RGB colorspace by default, but in certain cases you may get better results with a different colorspace. string corresponds to one of several color models. The values we are interested in are:
RGB
: red, green, blueGray
(not “Grey”): grayscaleTransparent
: RGB with retained transparent colors (if any)YIQ
: a color model used by NTSCYUV
: Luminance, Chrominance used by MPEGYCbCr
: a variant ofYUV
that gives good results with skin tonesCMYK
: Cyan, Magenta, Yellow, Black
The colorspace
attribute must be followed by a
Quantize( )
method call for
the change to take effect. The attribute may also be set directly
from the Quantize( )
call, as in:
$image->Quantize(colorspace=>'Gray');
Get Programming Web Graphics with Perl and GNU Softwar now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.