I want to convert (a lot of) JPEG images to the Sun Raster format (see here for instance), because my program can only use this format.
The issue is that my program only allows images of type Old or Standard i.e. with pixel written in the BGR order. (I should change that but don't have the time). By default, ImageMagick generates files in the RGB format.
I have found a trick to swap the color planes, but as the file is style written as RGB I get fancy colors.
This is probably a simple option to pass to ImageMagick, but I didn't find it. Do you have an idea?
Another way to swap colors is to use the -color-matrix
option. For example, to convert RGB to BGR:
convert input.png -color-matrix '0 0 1
0 1 0
1 0 0' output.png
Reference: http://www.imagemagick.org/Usage/color_mods/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With