Dear Master,
I'm using CompositeImageChannel to compose CMYK files, But black channel always appear "black" no any image in in.
C,M,Y channels are look very well.
.
.
status = CompositeImageChannel(cmykImage, BlackChannel , CopyBlackCompositeOp , srcImage, 0, 0);
.
.
WriteImage(imageInfo, cmykImage);
somebody can help me to figure out , thanks!!
Compose CMYK Files Using CompositeImageChannel function
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Compose CMYK Files Using CompositeImageChannel function
The problem is that it copies channels. A RGB Greyscale image does not contain Black.
As such you get nothing copied!
See...
http://www.imagemagick.org/Usage/bugs/testing/
Yes I do consider this a bug. One that has been present for a VERY VERY long time.
In my thinking, if the source image is not CMYK, and thus does NOT contain a black channel, that image should be treated as a greyscale source for the black channel data. This is basically what CopyOpacity does.
The way around this is to use -combine with four greyscale channel images to build the CMYK image.
Alternative you can use -channel K -combine to convert a single greyscale image to a CMYK image with only the back channel as valid, then use CopyBlack to merge it into the other image.
As such you get nothing copied!
See...
http://www.imagemagick.org/Usage/bugs/testing/
Yes I do consider this a bug. One that has been present for a VERY VERY long time.
In my thinking, if the source image is not CMYK, and thus does NOT contain a black channel, that image should be treated as a greyscale source for the black channel data. This is basically what CopyOpacity does.
The way around this is to use -combine with four greyscale channel images to build the CMYK image.
Alternative you can use -channel K -combine to convert a single greyscale image to a CMYK image with only the back channel as valid, then use CopyBlack to merge it into the other image.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Compose CMYK Files Using CompositeImageChannel function
Dear Master,
Sorry! I just focus on C function, not command.
Your mean is use CombineImages() function. Right?
Thank for quickly reply.
Diuming
Sorry! I just focus on C function, not command.
Your mean is use CombineImages() function. Right?
Thank for quickly reply.
Diuming
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Compose CMYK Files Using CompositeImageChannel function
Correct. BUT just as in the Command ling API there is a trick to 'combining' RGB greyscale channel images into a non-RGB image.
You first need to 'set' (that is just set, don't actually change) the colorspace of the incoming images, so when CombineImages() creates a new image, it creates it in the correct color space. It is a little bit of a 'hack' but it works for generating the special 4 channel CMYK image.
The details were worked out for command line API, but the exact same equivalent method is used for any other API too.
You first need to 'set' (that is just set, don't actually change) the colorspace of the incoming images, so when CombineImages() creates a new image, it creates it in the correct color space. It is a little bit of a 'hack' but it works for generating the special 4 channel CMYK image.
The details were worked out for command line API, but the exact same equivalent method is used for any other API too.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Compose CMYK Files Using CompositeImageChannel function
I got it.
thank you so much!!
Diuming
thank you so much!!
Diuming