Converting image with this command gm convert board.jpg -gravity center -background red -extent 600x600 board_out.jpg
gives blue background, instead of red
This problem is occuring because your JPEG file is in CMYK colorspace
rather than RGB.
Use
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gm convert board.jpg -colorspace rgb -gravity center
-background red -extent 600x600 board_out.jpg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and then the result will be more what was expected. However, the
built-in conversion to RGB is simplistic since there are many
(infinite) CMYK colorspaces. Using an appropriate CMS color profile
is necessary in order to accurately convert from CMYK to RGB or from
RGB (what the background color is expressed as) to CMYK. With some
effort, the correct hex color specification needed to represent the
background color in CMYK representation could be used.
I don't know if your original board.jpg contained a CMS profile but as
downloaded from SourceForge, it does not.
This problem is occuring because your JPEG file is in CMYK colorspace
rather than RGB.
Use
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gm convert board.jpg -colorspace rgb -gravity center
-background red -extent 600x600 board_out.jpg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and then the result will be more what was expected. However, the
built-in conversion to RGB is simplistic since there are many
(infinite) CMYK colorspaces. Using an appropriate CMS color profile
is necessary in order to accurately convert from CMYK to RGB or from
RGB (what the background color is expressed as) to CMYK. With some
effort, the correct hex color specification needed to represent the
background color in CMYK representation could be used.
I don't know if your original board.jpg contained a CMS profile but as
downloaded from SourceForge, it does not.
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
That worked fine!
Thank you very much!