]> git.imager.perl.org - imager.git/commitdiff
- new example for convert() method based on Leolo's query
authorTony Cook <tony@develop=help.com>
Fri, 26 Aug 2005 05:04:37 +0000 (05:04 +0000)
committerTony Cook <tony@develop=help.com>
Fri, 26 Aug 2005 05:04:37 +0000 (05:04 +0000)
Changes
lib/Imager/Transformations.pod

diff --git a/Changes b/Changes
index c37958375da9fc569c6dc2d78b10fba10bd2984a..48ea843a368b7a7594cd267d40c7b0698a795cf6 100644 (file)
--- 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
 
 =================================================================
 
index f1cf883bd6bbc048a4934031277e82ffc2dfc5bd..b5c98f5554ed96b5a48b57b117c1337a3b423824 100644 (file)
@@ -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