It currently says:
Code: Select all
When separating and recombining channels, with potential intermediate processing, it is important to identify the colorspace used, especially during the recombination. For example,
magick myimage.png -separate myimage_channels_%d.png
magick myimage_channels_*.png -combine myimage2.png
In the above example, the result is darker than the original, because the channels were separate as linear gray and subsequently combined as linear color. In order to return the channels back to sRGB, one must change the colorspace from RGB back to sRGB after the -combine step.
magick myimage.png -separate myimage_channels_%d.png
magick myimage_channels_*.png -combine -colorspace sRGB myimage2.png
If one desires to separate to non-linear grayscale channels, recombine them later, perhaps after some processing, then use the same concept as above for maintaining non-linear grayscale:
magick myimage.png -set colorspace RGB -separate myimage_channels_%d.png
magick myimage_channels_*.png -combine -colorspace RGB -set colorspace sRGB myimage2.png
Code: Select all
When separating and recombining channels, with potential intermediate processing, it is important to identify the colorspace used, especially during the recombination. For example,
magick myimage.png -separate myimage_channels_%d.png
magick myimage_channels_*.png -combine myimage2.png
In the above example, the separated channels are non-linear and the default for -combine is to assume non-linear channels. So the result is the same as the input.
If one desires to separate to linear grayscale channels, recombine them later back to non-linear color, perhaps after some processing, then use the same concept as above for maintaining linear grayscale:
magick myimage.png -set colorspace RGB -separate myimage_channels_%d.png
magick myimage_channels_*.png -set colorspace RGB -combine -colorspace sRGB myimage2.png
Code: Select all
To declare that an image is linear RGB rather than sRGB, you can use the set option:
magick myimage.png -set colorspace RGB myRGBimage.png
Afterwards, the verbose information for the output file lists the colorspace as RGB. This only works on image types containing meta data that distinguishes between linear RGB and non-linear sRGB, such as PNG and GIF. Therefore, if the above command is run with a JPG or TIF output format, the verbose information for the colorspace still shows sRGB. In order to properly have the JPG output know that it is linear RGB, include an appropriate color profile.
Code: Select all
Note that declaring an image as linear is not the same as converting the image to linear. Declaring it is linear only sets the meta data and does not change the pixel data. Whereas converting to linear actually changes the pixel data as described in more detail below.