Suggested Enhancements to channel issues
Posted: 2007-09-07T11:47:54-07:00
Hello,
I would like to suggest some possible enhancements to how channels are handled in IM.
To access a (RGB or some other colorspace) channel one has to do:
convert image.png -colorspace RGB -separate image_%d.png
(where -colorspace RGB is optional if you know the image is already RGB)
or each channel one at a time, say to get just the green channel
convert image.png -colorspace RGB -separate Green image_green.png
Then to recombine them later one has to do
convert image_0.png -colorspace RGB \
image_0.png -compose CopyRed -composite \
image_1.png -compose CopyGreen -composite \
image_2.png -compose CopyBlue -composite \
-colorspace RGB image_recombined.png
(again where -colorspace RGB is optional if you know it is already RGB)
This latter step is rather awkward.
I was wondering how feasible it might be to handle channels much like you do frames. So one might use { channel# } as you do [ frame# }
Thus one would do
convert image.png{ 1 } ...some processing functions... image_green_processed.png
and to recombine each channel into a color image, you would do.
convert image_red.png image_green.png image_blue.png -colorspace RGB image_color.png
or some new function to recombine such as
convert image_red.png image_green.png image_blue.png -unite RGB image_color.png
Thanks for giving this some consideration.
Fred Weinhaus
fmw@alink.net
I would like to suggest some possible enhancements to how channels are handled in IM.
To access a (RGB or some other colorspace) channel one has to do:
convert image.png -colorspace RGB -separate image_%d.png
(where -colorspace RGB is optional if you know the image is already RGB)
or each channel one at a time, say to get just the green channel
convert image.png -colorspace RGB -separate Green image_green.png
Then to recombine them later one has to do
convert image_0.png -colorspace RGB \
image_0.png -compose CopyRed -composite \
image_1.png -compose CopyGreen -composite \
image_2.png -compose CopyBlue -composite \
-colorspace RGB image_recombined.png
(again where -colorspace RGB is optional if you know it is already RGB)
This latter step is rather awkward.
I was wondering how feasible it might be to handle channels much like you do frames. So one might use { channel# } as you do [ frame# }
Thus one would do
convert image.png{ 1 } ...some processing functions... image_green_processed.png
and to recombine each channel into a color image, you would do.
convert image_red.png image_green.png image_blue.png -colorspace RGB image_color.png
or some new function to recombine such as
convert image_red.png image_green.png image_blue.png -unite RGB image_color.png
Thanks for giving this some consideration.
Fred Weinhaus
fmw@alink.net