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
You should use two separate density settings:
MagickReadSettings settings = new MagickReadSettings()
{
  Density = new Density(600)
};

using (MagickImage image = new MagickImage(@"d:\images\pdf\parcelforce.pdf", settings))
{
  Density desiredDensity = new Density(400);
  MagickGeometry geometry = desiredDensity.ToGeometry(4, 6);

  image.Resize(geometry);

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

  // Create byte array that contains a Png byte[] data = image.ToByteArray();
}
The first one is what you want it to be when the image is read and the second one is what you want it to be when the image is printed. You need to do this because when you use 400 for both values you will resize the image to a bigger size and that will have a bad affect on the quality. With this I get a good output image. But the logo is stored with a terrible quality in the image. You cannot make this better.

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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