convert.im - image conversions
out = i_convert(srcimage, coeff, outchans, inchans)
Converts images from one format to another, typically in this case for converting from RGBA to greyscale and back.
Converts the image src into another image.
coeff contains the co-efficients of an outchan x inchan matrix, for each output pixel:
coeff[0], coeff[1] ... im[x,y] = [ coeff[inchan], coeff[inchan+1]... ] * [ src[x,y], 1] ... coeff[inchan*outchan-1]
If im has the wrong number of channels or is the wrong size then i_convert() will re-create it.
Now handles images with more than 8-bits/sample.
Test if the coefficients represent just copying channels around, and initialize lists of the channels to copy, zero or set to max.
Perform a convert that only requires channel copies.
Imager(3)
Tony Cook <tony@develop-help.com>
To install Imager, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Imager
CPAN shell
perl -MCPAN -e shell install Imager
For more information on module installation, please visit the detailed CPAN module installation guide.