Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Losing transparency with CMYK

$
0
0
I tried to see if the image contains an alpha channel with Ghostscript but it looks like your image does not seem to contain an alpha channel:
D:\Images\eps>"C:\Program Files\gs\gs9.15\bin\gswin64c.exe" -q -dQUIET -dSAFER -
dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=
2 "-sDEVICE=tiffsep" "-r72x72" -g297x80 -dEPSCrop -dPrintSpotCMYK=true  "-sOutpu
tFile=test.tiff" "-fcartoon_network_logo_r.eps"
%%SeparationColor: "Cyan" 100% ink = 32760 0 0 0 CMYK
%%SeparationColor: "Magenta" 100% ink = 0 32760 0 0 CMYK
%%SeparationColor: "Yellow" 100% ink = 0 0 32760 0 CMYK
%%SeparationColor: "Black" 100% ink = 0 0 0 32760 CMYK
Ghostscript will draw the text on a transparent background when you set the ColorSpace to RGB. Ghostscript does not do that for CMYK images. I did however manage to accomplish what you want with the following trick/work-around:
string sourceFilePath = @"D:\images\eps\cartoon_network_logo_r.eps";

// Read as CMYKusing (MagickImage cmyk = new MagickImage(sourceFilePath))
{
  MagickReadSettings settings = new MagickReadSettings();
  settings.ColorSpace = ColorSpace.sRGB;

  // Read as RGBAusing (MagickImage rgba = new MagickImage(sourceFilePath, settings))
  {
    // Copy alpha channel from RGBA to CMYK image
    cmyk.Composite(rgba, Gravity.Center, CompositeOperator.CopyAlpha);

    cmyk.Write(@"D:\test.png");
  }
}
There is only one problem with the example, it does not work with the current release of Magick.NET due to a bug. You will have to wait till the next release or contact me to get a development build.

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>