pdf2jpg with fancy black squares

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
privet

pdf2jpg with fancy black squares

Post by privet »

I'm trying to convert a PDF to JPG with convert.exe.
The PDF-File contains tables and lists with text.
I'm trying to get a very sharp and readable result.

Unfortunately, the list-icons in the result are big black squares in the JPG-file instead of the original tiny round dots...

my call:
convert -trim -posterize 9 +matte -geometry 650 -linewidth 1 -identify -enhance +dither -colors 16 +contrast +contrast -density 88 -black-point-compensation -quality 100 -unsharp 0.7x1.1+2.0+0 2.pdf 2.jpg

Is there a possibility to get a small and beauty icon at converting lists in PDF?

Example: http://www.nabble.com/file/p21711416/pdf2pic_list.jpg
input-PDF: http://www.nabble.com/file/p21711416/_table_0.pdf
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: pdf2jpg with fancy black squares

Post by el_supremo »

ImageMagick uses Ghostscript to do the PDF conversion so you need to check whether you are using a recent version of GS. I tried your command with GS 8.63 and it uses dots.

Your command line looks overly complex too. I used this:

Code: Select all

convert -density 300 2.pdf -colors 16 -resize 25%x25% -quality 100 2.jpg
You may find that starting with a high density and then resizing it down will produce a better quality final image, although it will require more CPU time to do the conversion.
Also, JPG is not a good format when saving a text image. PNG or GIF are better.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: pdf2jpg with fancy black squares

Post by anthony »

Also you may be getting a lot of trouble due to youre reading the input image AFTER giving all the options.

Try just setting the input density, reading the PDF, then applying the operators to that image before outputing.

That is do things in the order you want them done, including reading of the image!

See IM Examples, Basics for more details
http://www.imagemagick.org/Usage/basics/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
privet

Re: pdf2jpg with fancy black squares

Post by privet »

SUCCESS:

1. using GS 8.63 instead of 8.00 solved the problem with the black squares.
I have now the tiny dots as list-icons!

2. I put the parameter 'density' and the input-pdf-filename on the beginning
of the parameter chain. The result: the pics are now more readable!

Thanks a lot for the hints!
Post Reply