Menu

#412 Background problem with Extent

v1.0_(example)
closed-wont-fix
None
5
2017-03-04
2017-02-15
No

Converting image with this command
gm convert board.jpg -gravity center -background red -extent 600x600 board_out.jpg
gives blue background, instead of red

2 Attachments

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2017-02-15

    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/

     
  • Janis Briedis

    Janis Briedis - 2017-02-16

    That worked fine!
    Thank you very much!

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2017-03-04
    • status: open --> closed-wont-fix
    • assigned_to: Bob Friesenhahn
     

Log in to post a comment.

MongoDB Logo MongoDB