Combining HSB back to RGB
Posted: 2007-07-12T10:37:36-07:00
Hi,
I would very much like to separate an RGB image to HSB, process the B and/or S channels and then recombine them back to RGB looking like an enhanced version of the original. I have been able to do the first two steps successfully, but I can find no way to reverse the process and go from HSB channels back to a single proper RGB colorspace image.
This seems to work properly to get 3 H,S,B channel images from an RBG image
convert fred1_rgb.jpg -colorspace HSB -separate fred1_hsb_%d.png
But the following puts the images back as if they were RBG channels
convert fred1_hsb_0.png fred1_hsb_1.png fred1_hsb_2.png -combine fred1_hsb.png
as doing
identify -verbose fred1_hsb.png reports the colorspace as RGB
and there does not seem to be a way to force the colorspace to HSB such as
convert fred1_hsb_0.png fred1_hsb_1.png fred1_hsb_2.png -colorspace HSB -combine fred1_hsb2.png
convert fred1_hsb2.png -colorspace RGB fred1_rgb2.png
It would be nice to be able to set the colorspace to HSB when combining so that one could could convert back to RGB.
In general, it would be nice to be able to transform back and forth between and two color spaces or at least RBG <-> any other 3-channel colorspace and RBG <-> CYMK
Fred Weinhaus
I would very much like to separate an RGB image to HSB, process the B and/or S channels and then recombine them back to RGB looking like an enhanced version of the original. I have been able to do the first two steps successfully, but I can find no way to reverse the process and go from HSB channels back to a single proper RGB colorspace image.
This seems to work properly to get 3 H,S,B channel images from an RBG image
convert fred1_rgb.jpg -colorspace HSB -separate fred1_hsb_%d.png
But the following puts the images back as if they were RBG channels
convert fred1_hsb_0.png fred1_hsb_1.png fred1_hsb_2.png -combine fred1_hsb.png
as doing
identify -verbose fred1_hsb.png reports the colorspace as RGB
and there does not seem to be a way to force the colorspace to HSB such as
convert fred1_hsb_0.png fred1_hsb_1.png fred1_hsb_2.png -colorspace HSB -combine fred1_hsb2.png
convert fred1_hsb2.png -colorspace RGB fred1_rgb2.png
It would be nice to be able to set the colorspace to HSB when combining so that one could could convert back to RGB.
In general, it would be nice to be able to transform back and forth between and two color spaces or at least RBG <-> any other 3-channel colorspace and RBG <-> CYMK
Fred Weinhaus