0
votes

I've solid black PNG (rgb 0,0,0), which I want to convert to CMYK TIFF. But it is not full black in output. I've set ICC color profiles correctly and also have set colorspace correctly. If I will do the same in PS or FastStone image viewer, I get same color as input PNG. Following is the command I use:

magick.exe "P:\Python\mask.png" -profile "P:\Python\sRGB.icc" -profile "P:\Python\USWebCoatedSWOP.icc" -colorspace CMYK "P:\Python\mask.tiff"

Please help me, this is really important for me.

Best regards, Ishaq

2
Try changing the colourspace to CMYK before adding the profile. - Mark Setchell
It produces same output. - Ishaq Khan
Did you check the output of both commands with magick identify -verbose mask.tiff to see if both contain the ICC profile? - Mark Setchell
I can verify it in PS. I open both tiff's and have same colors, which are not black. I try different ICC profiles as well with no luck. - Ishaq Khan
Can you try to figure it out on your side? What causes the color to get reddish? I shall be very thankful to be helped. Can even pay. - Ishaq Khan

2 Answers

1
votes

Do not use both profiles and -colorspace. If your input image has a color profile, then use only one profile. If it has no profiles, then use two profiles.

The following works fine for me on ImageMagick 7.0.11.3 Q16 Mac OSX. Perhaps the issue is with your viewer.

If this does not work for you, zip your input file and post it. Also identify your exact ImageMagick version and platform.

Create binary mask image:

magick logo: -transparent white -alpha extract mask.png

enter image description here

Process mask image:

magick mask.png -profile /Users/fred/images/profiles/sRGB.icc /Users/fred/images/profiles/USWebCoatedSWOP.icc -type colorseparation mask.tif

enter image description here

0
votes

I think it can be done by using PIL

from PIL import Image

img = Image.open('your_image.png')

img.save('image.tiff')