Convert color values from RGB to CMYK with ICC profile
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert color values from RGB to CMYK with ICC profile
Well spotted. I have reported it: viewtopic.php?f=3&t=25633
snibgo's IM pages: im.snibgo.com
Re: Convert color values from RGB to CMYK with ICC profile
Cool.
I will simply work with the swapped values meantime.
Thanks for the great help
I will simply work with the swapped values meantime.
Thanks for the great help
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert color values from RGB to CMYK with ICC profile
The bug occurs when "m" and "y" are used explicitly. Compare and contrast:
convert xc:cmyk(10%,20%,30%,40%) -colorspace CMYK -precision 9 -format "%[fx:100*p{0,0}.c]\%,%[fx:100*p{0,0}.m]\%,%[fx:100*p{0,0}.y]\%,%[fx:100*p{0,0}.k]\%\n" info:
10.000763%,30.000763%,20%,40%
convert xc:cmyk(10%,20%,30%,40%) -colorspace CMYK -precision 9 -format "%[pixel:p{0,0}]\n" info:
cmyk(10.000763%,20%,30.000763%,40%)
EDIT: This is a reply to a post that then vanished.
convert xc:cmyk(10%,20%,30%,40%) -colorspace CMYK -precision 9 -format "%[fx:100*p{0,0}.c]\%,%[fx:100*p{0,0}.m]\%,%[fx:100*p{0,0}.y]\%,%[fx:100*p{0,0}.k]\%\n" info:
10.000763%,30.000763%,20%,40%
convert xc:cmyk(10%,20%,30%,40%) -colorspace CMYK -precision 9 -format "%[pixel:p{0,0}]\n" info:
cmyk(10.000763%,20%,30.000763%,40%)
EDIT: This is a reply to a post that then vanished.
snibgo's IM pages: im.snibgo.com
Re: Convert color values from RGB to CMYK with ICC profile
Hi Everyone,
sorry for warming this thread up, but i ran into the same trouble with the exact behaviour.
I tried the upper commands and they work like expected, but the color seems not to be similar like photoshop.
If i run the following command i get cmyk(100,0,0,0) instead of cmyk(80,24,0,0):
can someone maybe share some insights how i get the right conversion like in the upper post from Tricon?
Thanks in advance,
sorry for warming this thread up, but i ran into the same trouble with the exact behaviour.
I tried the upper commands and they work like expected, but the color seems not to be similar like photoshop.
If i run the following command i get cmyk(100,0,0,0) instead of cmyk(80,24,0,0):
Code: Select all
convert xc:rgb\(0,255,255\) -precision 9 -colorspace cmyk -format "%[fx:int(100*c)], %[fx:int(100*m)], %[fx:int(100*y)], %[fx:int(100*k)]\r\n" info:
Thanks in advance,
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert color values from RGB to CMYK with ICC profile
See upthread. Tricon was using "-profile" for the conversions, not "-colorspace".
snibgo's IM pages: im.snibgo.com
Re: Convert color values from RGB to CMYK with ICC profile
wow thanks for the fast reply!
i tried it also with the profile:
but if i do so, i get the following i get the following:
any ideas, what i can do?
i tried it also with the profile:
Code: Select all
convert xc:'rgb(0,255,255)' -profile AdobeRGB1998.icc -profile CoatedFOGRA39.icc -precision 9 -format "%[fx:int(100*c)], %[fx:int(100*m)], %[fx:int(100*y)], %[fx:int(100*k)]\r\n" info:
Code: Select all
convert: delegate library support not built-in `rgb(0,255,255)' (LCMS) @ warning/profile.c/ProfileImage/849.
convert: ColorSeparatedImageRequired `' @ error/fx.c/FxGetSymbol/1647.
0, 100, 100,
Re: Convert color values from RGB to CMYK with ICC profile
What operating system are you using and what version of Imagemagick?
Have you tried something simple to ensure Imagemagick is working on your setup?
Have you tried something simple to ensure Imagemagick is working on your setup?
Re: Convert color values from RGB to CMYK with ICC profile
Hi Bonzo,
Its a Imagemagick on a OSX, handled over the Terminal-application. simple image generations are working.
Version: ImageMagick 6.9.1-4
Any ideas?
Its a Imagemagick on a OSX, handled over the Terminal-application. simple image generations are working.
Version: ImageMagick 6.9.1-4
Any ideas?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Convert color values from RGB to CMYK with ICC profile
What does "convert -version" say? It should be something like:
If it doesn't say lcms under delegates, that's the problem.
Code: Select all
Version: ImageMagick 6.9.1--6 Q16 x64 2015-06-20 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib
snibgo's IM pages: im.snibgo.com
Re: Convert color values from RGB to CMYK with ICC profile
Hi snibgo,
THX so much! after reinstall of ImageMagick with littleCMS it works like charme now!!
THX so much! after reinstall of ImageMagick with littleCMS it works like charme now!!
Re: Convert color values from RGB to CMYK with ICC profile
Ok, now i'm facing the last problem of the overall topic.
I get now from rgb(0,255,255) the following cmyk(56,0,18,0) value, what is obvious the right one like in photoshop.
But now i need to reconvert it into the right rgb value to visualize it to the customer.
i tried the following:
but it gives me rgb(81, 91, 94) back what is not correct. It should be something like rgb(85,198,212).
do anyone already figured out how this works?
Best,
I get now from rgb(0,255,255) the following cmyk(56,0,18,0) value, what is obvious the right one like in photoshop.
But now i need to reconvert it into the right rgb value to visualize it to the customer.
i tried the following:
Code: Select all
convert xc:'cmyk(56,0,18,0)' -profile CoatedFOGRA39.icc -profile sRGB.icc -precision 9 -format "%[fx:int(100*r)], %[fx:int(100*g)], %[fx:int(100*b)]\r\n" info:
do anyone already figured out how this works?
Best,
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Convert color values from RGB to CMYK with ICC profile
The issue is that you have specified cmyk values in the range 0 to 255, but are requesting results in %. Note that in fx, r=u.r and either is in the range of 0 to 1. So your results are percent and not raw values. To get correspondence, multiply by 255 or use 100 and add %. I am using IM 6.9.1.10 Q16 Mac OSX
78.04%, 100%, 92.94%
199, 255, 237
srgb(199,255,237)
All these results agree with results from the color converter at http://www.imagemagick.org/contrib/color-converter.php
Using profiles will give slightly different result, depending upon the profiles used. For example:
195, 231, 235
Code: Select all
convert xc:'cmyk(56,0,18,0)' \
-set colorspace CMYK -colorspace sRGB \
-precision 4 -format "%[fx:100*r]\%, %[fx:100*g]\%, %[fx:100*b]\%\n" info:
Code: Select all
convert xc:'cmyk(56,0,18,0)' \
-set colorspace CMYK -colorspace sRGB \
-format "%[fx:int(255*r)], %[fx:int(255*g)], %[fx:int(255*b)]\n" info:
Code: Select all
convert xc:'cmyk(56,0,18,0)' \
-set colorspace CMYK -colorspace sRGB \
%[pixel:u.p{0,0}]\n" info:
All these results agree with results from the color converter at http://www.imagemagick.org/contrib/color-converter.php
Using profiles will give slightly different result, depending upon the profiles used. For example:
Code: Select all
convert xc:'cmyk(56,0,18,0)' \
-set colorspace CMYK -profile /users/fred/images/profiles/USWebCoatedSWOP.icc \
-profile /users/fred/images/profiles/sRGB.icc \
-format "%[fx:int(255*r)], %[fx:int(255*g)], %[fx:int(255*b)]\n" info: