[ 1, 0, 0 ],
[ 0, 0, 1 ] ]);
+ # build an image using channels from multiple input images
+ $new = $img->combine(src => [ $im1, $im2, $im3 ]);
+ $new = $img->combine(src => [ $im1, $im2, $im3 ],
+ channels => [ 2, 1, 0 ]);
+
# limit the range of red channel from 0..255 to 0..127
@map = map { int( $_/2 } 0..255;
$img->map( red=>\@map );
=over
-=item copy
+=item copy()
To create a copy of an image use the C<copy()> method. This is useful
if you want to keep an original after doing something that changes the image.
$newimg = $orig->copy();
-=item scale
+=item scale()
X<scale>To scale an image so proportions are maintained use the
C<$img-E<gt>scale()> method. if you give either a C<xpixels> or
For example, if the original image is 400 pixels wide by 200 pixels
high and C<xpixels> is set to 300, and C<ypixels> is set to 160. When
C<type> is C<'min'> the resulting image is 300 x 150, when C<type> is
-C<'max'> the resulting image is 320 x 150.
+C<'max'> the resulting image is 320 x 160.
C<type> is only used if both C<xpixels> and C<ypixels> are supplied.
=over
-=item paste
+=item paste()
X<paste>To copy an image to onto another image use the C<paste()>
method.
If the source image has an alpha channel and the target doesn't, then
the source is treated as if composed onto a black background.
-If the source image is color and the target is gray scale, the the
+If the source image is color and the target is gray scale, the
source is treated as if run through C<< convert(preset=>'gray') >>.
=item rubthrough()
=item *
-C<tx>, C<ty> - location in the the target image ($self) to render the
+C<tx>, C<ty> - location in the target image ($self) to render the
top left corner of the source.
=item *
=item *
-C<tx>, C<ty> - location in the the target image ($self) to render the top
+C<tx>, C<ty> - location in the target image ($self) to render the top
left corner of the source. These can also be supplied as C<left> and
C<right>. Default: (0, 0).
compose() returns true on success. On failure check $target->errstr
for the reason for failure.
-=item flip
+=item flip()
An inplace horizontal or vertical flip is possible by calling the
C<flip()> method. If the original is to be preserved it's possible to
=over
-=item convert
+=item convert()
You can use the convert method to transform the color space of an
image using a matrix. For ease of use some presets are provided.
[ 0, 0, 0, 0.5 ],
]);
+=item combine()
+X<combine>
+
+Combine channels from one or more input images into a new image.
+
+Parameters:
+
+=over
+
+=item *
+
+C<src> - a reference to an array of input images. There must be at least
+one input image. A given image may appear more than once in C<src>.
+
+=item *
+
+C<channels> - a reference to an array of channels corresponding to the
+source images. If C<channels> is not supplied then the first channel
+from each input image is used. If the array referenced by C<channels>
+is shorter than that referenced by C<src> then the first channel is
+used from the extra images.
+
+=back
+
+ # make an rgb image from red, green, and blue images
+ my $rgb = Imager->combine(src => [ $red, $green, $blue ]);
+
+ # convert a BGR image into RGB
+ my $rgb = Imager->combine(src => [ $bgr, $bgr, $bgr ],
+ channels => [ 2, 1, 0 ]);
+
+ # add an alpha channel from another image
+ my $rgba = Imager->combine(src => [ $rgb, $rgb, $rgb, $alpha ],
+ channels => [ 0, 1, 2, 0 ]);
+
=back
=head2 Color Mappings
=over
-=item map
+=item map()
You can use the map method to map the values of each channel of an
image independently using a list of look-up tables. It's important to
=head1 AUTHOR
-Tony Cook <tony@imager.perl.org>, Arnar M. Hrafnkelsson
+Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson
=head1 REVISION