From sRGB to CMYK and gamma?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
joew
Posts: 42
Joined: 2012-08-23T01:19:56-07:00
Authentication code: 67789

Re: From sRGB to CMYK and gamma?

Post by joew »

snibgo wrote:"-set colorspace RGB -colorspace sRGB"
The first declares the colorspace to be RGB. The second means "If not already sRGB, convert the pixel values to sRGB." Thus the conversion will occur.

"-set colorspace sRGB -colorspace sRGB"
The first declares the colorspace to be sRGB*. The second means "If not already sRGB, convert the pixel values to sRGB." It is already sRGB, so no conversion will occur.
With this reasoning, the examples I've given in viewtopic.php?p=102045#p102045 should not have given different results. Let's take a look on them again:

Code: Select all

convert -set colorspace RGB  -colorspace RGB  -size 100x100 xc:#bebebe -colorspace sRGB 1.png
convert -set colorspace RGB  -colorspace sRGB -size 100x100 xc:#bebebe -colorspace sRGB 2.png
convert -set colorspace sRGB -colorspace RGB  -size 100x100 xc:#bebebe -colorspace sRGB 3.png
convert -set colorspace sRGB -colorspace sRGB -size 100x100 xc:#bebebe -colorspace sRGB 4.png
You say the "-set colorspace XXX -colorspace XXX" has no effect, since no image is loaded at this time. If that would be true, all four commands would turn into

Code: Select all

convert -size 100x100 xc:#bebebe -colorspace sRGB 1.png
convert -size 100x100 xc:#bebebe -colorspace sRGB 2.png
convert -size 100x100 xc:#bebebe -colorspace sRGB 3.png
convert -size 100x100 xc:#bebebe -colorspace sRGB 4.png
which is exctly the same command. So why do 1.png and 3.png result in a different color than 2.png and 4.png?

BTW: How do I declare colorspace without actually converting anything in PerlMagic? In the docs I've found no hints about colorspace handling at all. By try-and-error I found that

Code: Select all

$image->Set(colorspace=>"XXX");
seems to do the setting and the conversion. How would I declare without converting?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: From sRGB to CMYK and gamma?

Post by snibgo »

See my response at the bottom of page 2.

Sorry, I don't know perl.
snibgo's IM pages: im.snibgo.com
holden
Posts: 79
Joined: 2013-02-07T08:22:57-07:00
Authentication code: 6789

Re: From sRGB to CMYK and gamma?

Post by holden »

Getting back to the original issue- what does the image look like after processing through IM sans any color manipulation? The big problem so far seems to be that they were coming out too dark.

* I work at a photo lab, the biggest color hurdle is simply adjusting one's monitor to the printer. Beyond that different surfaces/papers/process can have subtle, or sometimes big, differences. The tools on our end take care of the colorspace/profiling.

** Just to further complicate things, as an oil painter, I've learned that the color of a piece is largely dependent on the lighting it is displayed in. So more food for thought on subjectivity.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: From sRGB to CMYK and gamma?

Post by fmw42 »

What version of IM and platform? What was your exact command that comes out too dark? Can you provide a link to an example input and output?
Post Reply