0

I have two systems one is CentOS 6.2 Final, and another is Ubuntu 14.04, they both have ImageMagick installed on it. The following versions are installed.

On Ubuntu:

Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC

Features: OpenMP

On Centos:

Version: ImageMagick 6.5.4-7 2014-02-10 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

I have used the same command on both the systems and they produce different results.

Command:

 convert \
    ~/source.png \
      \( -clone 0 -fill  'rgba(50,129,75,5)' -colorize 100% \) \
   -channel rgba \
   -alpha on \
   -compose Multiply \
   -composite \
    out.png

Output by CentOS:

enter image description here

Output by Ubuntu

enter image description here

I am not sure why there is such a color difference on both the systems. Please help.

Output on CentOS is the expected Output.

source.png:

enter image description here

With -colorspace RGB option the output is (which is not the desired result):

enter image description here

with -colorspace sRGB:

enter image description here

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
Naveen Agarwal
  • 559
  • 4
  • 18

1 Answers1

3

I think you have a problem with colourspaces, and you will probably need to set them explicitly to force ImageMagick to do what you mean since the defaults changed between the two versions you are running.

I suspect you want to do all your manipulation in a linear (RGB) colourspace but maybe want the resulting image in a non-linear sRGB colorspace, so you will need to force them like this:

convert source.png -colorspace RGB \
   \( -clone 0 -fill 'rgba(50,129,75,5)' -colorize 100% \) \
  -channel rgba -alpha on -compose Multiply \
  -composite -colorspace sRGB out.png
Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • If I use above command the result is same as the second image(refer the image under title "Output by Ubuntu"). If I use "-colorspace sRGB" in the beginning then the output is close to what is expected(see the image under the title "with -colorspace sRGB"). – Naveen Agarwal Oct 07 '14 at 05:18