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

New Post: Converting from PDF to PNG image quality loss.

$
0
0
Using the follow code to convert a PDF in the form of a byte array to a PNG image.

It's converting it successfully and the PNG image is the correct size, 4 inches by 6 inches. The problem is the quality of the PNG its extremely blurred.

I've experimented with increased the density but it seems to be making little difference.
using (ImageMagick.MagickImage image = new ImageMagick.MagickImage(label.Label.Data))
{
    ImageMagick.Density density = new ImageMagick.Density(400, ImageMagick.DensityUnit.PixelsPerInch);
    ImageMagick.MagickGeometry geometry = density.ToGeometry(4, 6);

    image.Density = density;

    image.Resize(geometry);

    // Sets the output format to Png
    image.Format = ImageMagick.MagickFormat.Png;

    // Create byte array that contains a Png 
    byte[] data = image.ToByteArray();
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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