Hello world!
I want to simulate CMYK colors in RGB format, so user will have an idea how her uploaded file will be printed. It means that if someone uploads a sharp green RGB(0,255,0) I want to show something like RGB(105,180,69) but it should be shown in RGB because some browsers doesn't support CMYK. In Photoshop you can do this by changing color space to CMYK and then change it back RGB. I tried different ways in ImageMagick, some of them worked partially but still could not find a solid way for doing this. Any idea?
Simulating CMYK colors in RGB
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Simulating CMYK colors in RGB
sorry your comment is a bit confusing. you only talk about RGB colors where does the CMYK come in? If you can clarify perhaps we can help.
do you want something like this:
convert -size 100x100 xc:"cmyk(255,0,255,0)" -colorspace RGB test1.png
in the mean-time see the Interactive Color Convert at http://www.imagemagick.org/script/color.php
P.S. What version of IM are you using and on what platform?
do you want something like this:
convert -size 100x100 xc:"cmyk(255,0,255,0)" -colorspace RGB test1.png
in the mean-time see the Interactive Color Convert at http://www.imagemagick.org/script/color.php
P.S. What version of IM are you using and on what platform?
Last edited by fmw42 on 2011-06-23T20:42:22-07:00, edited 1 time in total.
Re: Simulating CMYK colors in RGB
Hi thanks for your quick reply
Both my input and output files are in RGB, but I want the output to "look like" it's CMYK (in which colors are usually more dull than RGB). So if I have a plain RGB(0,255,0) file, I want the output to be plain RGB(105,180,69). You can gain this in Photoshop by converting your RGB to CMYK, and then converting it back to RGB (or save it for web). I want to the same thing in IM.
I use ImageMagick 6.6.5-5 Q16 on Fedora rel. 14.
Both my input and output files are in RGB, but I want the output to "look like" it's CMYK (in which colors are usually more dull than RGB). So if I have a plain RGB(0,255,0) file, I want the output to be plain RGB(105,180,69). You can gain this in Photoshop by converting your RGB to CMYK, and then converting it back to RGB (or save it for web). I want to the same thing in IM.
I use ImageMagick 6.6.5-5 Q16 on Fedora rel. 14.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Simulating CMYK colors in RGB
Seems like a strange thing to do and PS is not working reversibly which is odd, since if you convert rgb to cmyk and back again you should be getting back the same rgb values.
I tried your experiment in PS and it does not make sense to me as when you convert to cmyk it should look totally different in fact it should be magenta and not green. So I have no idea what PS is doing. Also you have to consider what colorspace profile is being used by PS.
This seems to do something visually like what you want. You will have to play with profiles to get exactly what you want.
compare the following two images:
convert -size 100x100 xc:"RGB(0,255,0)" test1.png
convert -size 100x100 xc:"RGB(0,255,0)" -colorspace cmyk -profile Profiles/CMYK.icc -profile Profiles/AdobeRGB1998.icc test2.png
I tried your experiment in PS and it does not make sense to me as when you convert to cmyk it should look totally different in fact it should be magenta and not green. So I have no idea what PS is doing. Also you have to consider what colorspace profile is being used by PS.
This seems to do something visually like what you want. You will have to play with profiles to get exactly what you want.
compare the following two images:
convert -size 100x100 xc:"RGB(0,255,0)" test1.png
convert -size 100x100 xc:"RGB(0,255,0)" -colorspace cmyk -profile Profiles/CMYK.icc -profile Profiles/AdobeRGB1998.icc test2.png