This project has moved. For the latest updates, please go here.

Converting PDFs to Thumbnails creates Blur

Oct 13, 2015 at 2:51 PM
Hey,

I am using ImageMagick.Net to create thumbnails from PDFs of blueprints (fine lines, black on white). If I am using "classic" ImageMagick from the console (convert original.pdf -resize 500x500 thumb.png) I get a really nice thumbnail.

If I use Magick.net with the example code from the documentation
            MagickGeometry size = new MagickGeometry(500, 500);

            MagickReadSettings settings = new MagickReadSettings();
            // Settings the density to 300 dpi will create an image with a better quality
            settings.Density = new PointD(300, 300);

            using (MagickImageCollection images = new MagickImageCollection())
            {
                // Add all the pages of the pdf file to the collection
                images.Read(original, settings);

                int page = 1;
                foreach (MagickImage image in images)
                {
                    // Writing to png
                    //image.Format = MagickFormat.Png00;
                    image.Resize(size);
                    image.Write(destination + page + ".png");
                    page++;
                }
I get a very blurry thumbnail. I tried adjusting various settings but the result stays the same.

Does anyone have an idea, what might be the problem?
Coordinator
Oct 13, 2015 at 4:01 PM
Edited Oct 13, 2015 at 4:01 PM
I think you are using Magick.NET since you are posting to this discussion board and you are using classes that where not available in ImageMagick.NET :)

Can you try to see if disabling OpenCL solves your issue?
MagickNET.UseOpenCL = false;
Oct 13, 2015 at 4:24 PM
Works great! Thank you so much! And yes, I am using Magick.NET.
Coordinator
Oct 13, 2015 at 4:29 PM
There are some issues with resizing under OpenCL. We are investigating this but haven't been able to find the problem yet.
Coordinator
Nov 10, 2015 at 8:25 PM
Edited Nov 10, 2015 at 9:00 PM
The problem has been found and will be resolved in the next version of Magick.NET (7.0.0.0022)
Nov 11, 2015 at 12:15 PM
Awesome. Thanks for your work! :)