Page 1 of 1
convert background cmyk and flatten
Posted: 2011-04-07T07:58:09-07:00
by peegee
sorry for my bad english, but i hope you understand what i mean:
i have an transparent image "image_ean.png" (=ean-code on transparent background) and i want to save it as an cmyk-image with a cmyk-background (50/0/0/0).
Code: Select all
convert image_ean.png -background "cmyk(50%,0%,0%,0%)" -flatten -quality 100 -colorspace CMYK image_ean_cmyk.jpg
it works on a system width IM 6.2.9, but it doesn't work on IM 6.2.4.(i get a black background)
i'm not sure, if the version is the reason, because the IM-changelog starts at version 6.3, so i couldn't check this.
have you any idea, where the problem is?
Re: convert background cmyk and flatten
Posted: 2011-04-07T11:31:44-07:00
by fmw42
There have been many changes to PNG format over quite some releases. See changelog
http://www.imagemagick.org/script/changelog.php
I can only assume something was broken in your latter release. If you can, try upgrading to the current release.
You might try converting your transparent png to say transparent gif or tiff and then try processing that to see if it is a PNG problem or something else.
If you can post a link to your input image and your old successful output image, then others could test your problem.
Re: convert background cmyk and flatten
Posted: 2011-04-07T14:39:01-07:00
by peegee
i can only see the changlog starting with version 6.3.1.6. but what happend between 6.2.4. and 6.2.9.?
i will try your tip with the gif.
knows somebody an other way to get a cmyk-image (with declaration of the cmyk-background color) from a transparent png?
Re: convert background cmyk and flatten
Posted: 2011-04-07T15:21:43-07:00
by fmw42
This seems to work fine for me under IM 6.6.9.4 Q16 Mac OSX Tiger
Input: logo2t.png
convert logo2t.png -background "cmyk(50%,0%,0%,0%)" -flatten -quality 100 -colorspace CMYK logo2t_cmyk.jpg
when displayed with a viewer/browser that handles cmyk jpgs properly, I see a cyan colored background in the result, which is the RGB equivalent of cmyk(50%,0%,0%,0%).
If the above image looks dark, then your browser or viewer cannot properly handle cmyk jpgs
Re: convert background cmyk and flatten
Posted: 2011-04-07T22:00:58-07:00
by anthony
peegee wrote:i can only see the changlog starting with version 6.3.1.6. but what happend between 6.2.4. and 6.2.9.?
Lots of things. I have kept a copy of the change long for this reason.
Actually the ChangeLog did not list version numbers before IM v6.2.6-2, only dates, so it is a little hard how far back to go.
One patch on 2005-10-17
* Patch so ImageMagick will properly convert -fill 'cmyk(0,0,0,255)' to RGB.
However you may like to also note that ...
2006-03-06 6.2.6-4
* RGB to CMYK color conversion is now scaled properly.
an other way to get a cmyk-image (with declaration of the cmyk-background color) from a transparent png?
PNG Images do not store any CMYK or RGB colorspace reference. You can force a PNG to save CMY (or other three channel colorspace) by using -set colorspace RGB (so it does not change the stored data), but it will not save as a specific colorspace. You could save colorspace info as a separate image meta-data chunk. Not certain if it takes a color profile, but it might.
Re: convert background cmyk and flatten
Posted: 2011-04-08T03:17:45-07:00
by peegee
after an IM upgrade it works.
thank you for helping me.