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

New Post: Transparency lost converting eps to png via Magick.NET when ImageMagick source works perfectly

$
0
0
I'm having trouble maintaining transparency through Magick.NET converting from an EPS to PNG. When using Magick.NET I'm getting a plain white image, when using ImageMagick console I'm getting exactly what I expect.

A) What am I doing wrong that is causing the transparency loss
B) Is there a way to only pass direct console parameters such as I pass to ImageMagick console app?
C) Is there a way to see what would be passed to the console application upon the conversion?

File in question: http://www.myargosydirect.com/static/dam/assets/000/003/93eaeccc-fcd8-4ef1-bb46-08279a5c881a.eps

ImageMagick Console Code that works:
convert -colorspace RGB -density 72 -verbose 93eaeccc-fcd8-4ef1-bb46-08279a5c881a.eps 93eaeccc-fcd8-4ef1-bb46-08279a5c881a.png
Conversion Code (GetImageFormat returns MagickFormat.Png for this file):
        private void ConvertImage(IEnumerable<ImageSize> sizes, ImageInfo sourceInfo, MagickImage image) {
            foreach (var size in sizes) {
                if (!size.MatteImage) {
                    size.CalculateSize(sourceInfo);
                }
                image.Format = this.GetImageFormat(size.Destination);
                image.ColorSpace = global::ImageMagick.ColorSpace.RGB;
                image.Density = new MagickGeometry(size.Dpi, size.Dpi);
                image.Resize(size.MaxWidth, size.MaxHeight);
                using (var stream = new MemoryStream()) {
                    image.Write(stream);
                    size.Destination.Save(stream.ToArray());
                }
            }
        }

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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