另一种交换颜色的方法是使用-color-matrix
选项。例如,将RGB转换为BGR:
convert input.png -color-matrix '0 0 1
0 1 0
1 0 0' output.png
这是一个关于IT技术的网站,提供了有关图像操作的一些颜色调整信息。请点击上方链接进入。我有一个想法可以在RGB图像中交换红色和蓝色颜色:
convert ( image_RGB.bmp -channel B -separate ) \
( image_RGB.bmp -channel G -separate ) \
( image_RGB.bmp -channel R -separate ) -channel RGB -combine image_BGR.bmp
我本以为在Imagemagick中
convert image.jpg image.sun
or
convert image.jpg SUN:image.sun
convert logo.png -separate +channel -swap 0,2 -combine -colorspace sRGB logo_bgr.sun