Page 1 of 1

-colorspace sRGB equivalent in magick++?

Posted: 2014-11-17T19:33:11-07:00
by danieru
Hi everyone,

when I convert a pdf to an image the value and saturation seems wrong, but by adding -colorspace sRGB corrects the output image. Now I want to do the same in magick++ but I can't find the equivalent procedure.

I already try with colorSpace(sRGBColorspace) but it does nothing. Does anyone know how to do this with magick++?

The imagemagick's version is: 6.7.7-10

Re: -colorspace sRGB equivalent in magick++?

Posted: 2014-11-17T19:59:43-07:00
by fmw42
The imagemagick's version is: 6.7.7-10
There was a change in IM handling of colorspace about that time. You would be best to upgrade your version of IM and Magick++. Your version is about 120 releases old.

see
viewtopic.php?f=4&t=21269

Re: -colorspace sRGB equivalent in magick++?

Posted: 2014-11-18T00:04:34-07:00
by danieru
Thanks for your reply,
I update my imagemagick and is now 6.9.0-0, or at least that is what says convert -version:
Version: ImageMagick 6.9.0-0 Q16 x86_64 2014-11-17 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff x xml zlib
I also configure CodeBlocks to use magick++ 6.9.0-0 but is behaving the same as 6.7.7-10

My OS right now is: ubuntu 14.04

Re: -colorspace sRGB equivalent in magick++?

Posted: 2014-11-18T00:42:26-07:00
by danieru
Just to clarify, this is the image I get if convert a pdf to an image using imagemagick without -colorspace sRGB.
It is also what I get if only open the pdf and save it using magick++

Code: Select all

convert -density 72 -quality 90% Blender.pdf[0] Blender.jpg
Image
http://s11.postimg.org/uf4eg2wf5/Blender.jpg


And this is the image I get if I add -colorspace sRGB. This is also how I see it on Evince.

Code: Select all

convert -density 72 -quality 90% -colorspace sRGB Blender.pdf[0] BlendersRGB.jpg
Image
http://s27.postimg.org/s0wx6n1o1/Blenders_RGB.jpg
This is the image that I want to obtain with Magick++

[Mod note: The two images didn't show, so I added them as links.]

Re: -colorspace sRGB equivalent in magick++?

Posted: 2014-11-18T05:01:36-07:00
by danieru
I should've give this links of the images instead:
Image 1
Image 2

Re: -colorspace sRGB equivalent in magick++?

Posted: 2014-11-18T10:32:13-07:00
by fmw42
Your jpg image is CMYK. If your command below is not good color quality, then you should use profiles. Also -quality should come after reading the input and just before the output. It does not use %.

Code: Select all

convert -density 72 -quality 90% -colorspace sRGB Blender.pdf[0] BlendersRGB.jpg
With profiles and assuming the pdf is CMYK like the jpg, use

Code: Select all

convert -density 72 Blender.pdf[0] -profile /path2profile/USWebCoatedSWOP.icc  -profile /path2profile/sRGB.icc  -quality 90 BlendersRGB.jpg
or from the jpg below, which produces a result that is very close to what you want

Code: Select all

convert Blender.jpg -profile /path2profile/USWebCoatedSWOP.icc  -profile /path2profile/sRGB.icc  -quality 90 BlendersRGB.jpg

Re: -colorspace sRGB equivalent in magick++?

Posted: 2014-11-18T14:31:02-07:00
by danieru
If your command below is not good color quality
No no, the color with this command is okay for me. I'm just asking how to do the same that -colorspace sRGB does but with Magick++.
But if it not possible, then something similar.

With profiles and assuming the pdf is CMYK like the jpg, use

Code: Select all

convert -density 72 Blender.pdf[0] -profile /path2profile/USWebCoatedSWOP.icc  -profile /path2profile/sRGB.icc  -quality 90 BlendersRGB.jpg
It's weird, because it seems like it should in gimp but not on gTumb or Firefox.
Screenshot

Re: -colorspace sRGB equivalent in magick++?

Posted: 2014-11-18T15:00:37-07:00
by fmw42
Sorry, I do not know Magick++. But see colorspace under image attributes at http://www.imagemagick.org/Magick++/Ima ... Attributes