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

New Post: Increase DPI from 72 to 300 does not work

$
0
0
I converted it to JPG, and save it.

I then edit the JPG copy, and I tried the code at the top of this post on that test image, and it had a huge white border. So I realize I must resize it.

I then I tried this code, on that test image. And it blurred. What am I missing here? Something in this process is blurring it.

using (MagickImage resize = new MagickImage(folder + filename))
        {
            Single DPIChangeRatio = Convert.ToSingle(density) / Convert.ToSingle(res.X);
            resize.VirtualPixelMethod = VirtualPixelMethod.Transparent;
            resize.Resize(Convert.ToInt32(Convert.ToSingle(resize.Width) * DPIChangeRatio), Convert.ToInt32(Convert.ToSingle(resize.Height) * DPIChangeRatio));
            resize.Resample(density, density);
            resize.Density = new Density(density, density, DensityUnit.PixelsPerInch);

            filename = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(filename);
            resize.Write(folder + filename);
        }
I also tried flipping the order of Resize and Resample, but it made no difference.

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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