Hello dlemstra,
I did other tests and sometimes it works and sometimes not.
The link to the image:
https://www.dropbox.com/s/6dzz0xrh7fpho ... 0C%29?dl=0
I tried this code:
Code: Select all
using (MagickImage miPantone1 = new MagickImage("CMYK+4SPOT.pdf (PANTONE 371 C)"))
{
miPantone1.Transparent(MagickColors.White);
miPantone1.Write("1.tiff");
miPantone1.SetAttribute("colorspace", "CMYK");
miPantone1.Write("2.tiff");
miPantone1.Opaque(MagickColors.White, new MagickColor("cmyk(128,23,250,156)"));
miPantone1.Write("3.tiff");
}
The file "1.tiff" is correct. It's a transparent tiff with a black box.
The file "2.tiff" has been modified and the black box became a white box (CMYK 0,0,0,0). It's a strange behaviour because a black box should remain black. But the file is correctly a CMYK file.
For the 3.tiff, the opaque command instead of generating a dark green box (like the PANTONE specification (CMYK(50,9,98,61)) is a violet box (CMYK(77,99,0,4); I used MagickColors.White because of the previous color inversion.
I've also tried to replace MagickColors.White with new MagickColor("cmyk(0,0,0,0)") and in that case the Opaque command does nothing.
What am I doing wrong? How can I obtain a correct dark green box with the correct percentages of CMYK?
I also tried this that seems to work a little well (the 2.tiff is correct now. It remains Black):
Code: Select all
using (MagickImage miPantone1 = new MagickImage("CMYK+4SPOT.pdf (PANTONE 371 C)"))
{
miPantone1.Transparent(MagickColors.White);
miPantone1.Write("1.tiff");
miPantone1.ColorSpace = ColorSpace.CMYK;
miPantone1.Write("2.tiff");
miPantone1.Opaque(MagickColors.Black, new MagickColor("cmyk(128,23,250,156)"));
miPantone1.Write("3.tiff");
}
but the result of the Spot color is the same.
I also tried to use ColorCMYK as Color, with 0-255 range for colors and with percentages. The resulting color conversion is always the same. It seems that something RGB happens in the behind.
Thank you
Denis