TIFF RGBa multichannel conversion to CMYK

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?".
Post Reply
sqlabs
Posts: 3
Joined: 2011-02-03T06:39:45-07:00
Authentication code: 8675308

TIFF RGBa multichannel conversion to CMYK

Post by sqlabs »

Hello,

I have a TIFF image in RGBa format (RGB plus the alpha channel) and I need to create a new TIFF CMYK image composed by the 4 channels of the source image.
For example the R channel of the source image should became the C channel of the dest image (then G -> M, B->Y and the alpha channel should became the Y channel).
Once done I would need another way to reconvert this TIFF CMYK image back to a RGBa TIFF image reverting this channel conversion process.

Any help would be really appreciated.
Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: TIFF RGBa multichannel conversion to CMYK

Post by fmw42 »

try

convert rgba.tiff -set colorspace cmyk cmyk.tiff

this make r->c, g->m, b->y, a->k

If you want other orders then, you need to use -separate and the shuffled the images around (-swap) and then recombine in the order desired.


see http://www.imagemagick.org/Usage/channe ... bine_other
sqlabs
Posts: 3
Joined: 2011-02-03T06:39:45-07:00
Authentication code: 8675308

Re: TIFF RGBa multichannel conversion to CMYK

Post by sqlabs »

Do I need to install something more other than imagemagick on OSX?
I continue to receive a segmentation fault error message each time I try to execute the command you suggested me.

Thanks a lot.
sqlabs
Posts: 3
Joined: 2011-02-03T06:39:45-07:00
Authentication code: 8675308

Re: TIFF RGBa multichannel conversion to CMYK

Post by sqlabs »

fmw42:
so far I think to have just one step missed, I need to recombine 4 tif images into one single RGBa image.
(myimages_1.tif, myimages_2.tif, myimages_3.tif, myimages_4.tif)

I tried with a command like:
convert myimages_?.tif -set colorspace RGB -combine -colorspace RGB final_image.tif
but obviously the alpha channel is not set and I guess that myimages_4.tif is not used.

How can I specify myimages_4.tif as the alpha channel for my RGBa final_image.tif?

Thanks a lot for your help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: TIFF RGBa multichannel conversion to CMYK

Post by fmw42 »

I presume each of your 4 images are grayscale and represent rgba channels already. If so try

convert myimages_?.tif -alpha on -channel rgba -colorspace rgb -combine final_image.tif


If that does not work, then

convert myimages_0.tif myimages_1.tiff myimages_3.tiff -colorspace rgb -combine myimages_4.tif -alpha off -compose copy_opacity -composite final_image.tif

That will put the 4th image into the alpha channel. see http://www.imagemagick.org/Usage/compose/#copyopacity

However, I thought you wanted cmyk?
Post Reply