From: Tony Cook Date: Fri, 26 Aug 2005 05:04:37 +0000 (+0000) Subject: - new example for convert() method based on Leolo's query X-Git-Tag: Imager-0.48^2~114 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/80396f47b212d29f9623e2d2f0143a9f461bf72e - new example for convert() method based on Leolo's query --- diff --git a/Changes b/Changes index c3795837..48ea843a 100644 --- a/Changes +++ b/Changes @@ -1132,6 +1132,7 @@ Revision history for Perl extension Imager. available via errstr() - implement/test/document set_file_limits()/get_file_limits() methods, which allow limits on the size of image files read. +- new example for convert() method based on Leolo's query ================================================================= diff --git a/lib/Imager/Transformations.pod b/lib/Imager/Transformations.pod index f1cf883b..b5c98f55 100644 --- a/lib/Imager/Transformations.pod +++ b/lib/Imager/Transformations.pod @@ -401,6 +401,16 @@ or to convert a 3 channel image to greyscale using equal weightings: $new = $img->convert(matrix=>[ [ 0.333, 0.333, 0.334 ] ]) +Convert a 2 channel image (grayscale with alpha) to an RGBA image with +the grey converted to the specified RGB color: + + # set (RGB) scaled on the grey scale portion and copy the alpha + # channel as is + my $colored = $gray->convert(matrix=>[ [ ($red/255), 0 ], + [ ($green/255), 0 ], + [ ($blue/255), 0 ], + [ 0, 1 ], + ]); =head2 Color Mappings