Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
script-fu convert pdf to png WITHOUT antialiasing
I am not familiar with script-fu and I really have the urgent need for a script that converts a PDF to a PNG without the anti-aliasing. (raw). I want to do this with the Gimp because of the perfect result but till this moment I am not able to write a script that does also set the anti-aliasing off. 

Please can somebody help me??? 

Thanks in advance!!!
You don't ned Gimp for this. ImageMagick will do it very quickly:

magick convert image-in.pdf -threshold 50% image-out.png

(in older versions of IM the command is just "convert").
I was looking at this last night and also came up with ImageMagick (IM)

convert -density 100 -background white -flatten +antialias input.pdf output.png

-density to set the size, 300 might be best
+antialias one of those strange IM switches where '+' turns it off.

Then some questions which arise from your post, in particular RAW output which in Gimp is .data
That does not work with IM, the output defaults to pdf (without antialisaing) but a format such as PNM might be ok.

edit: read the post again and you want png, so that last bit is not needed, but what is meant by (raw)?

Looking at Gimp scripting procedures, opening a PDF does not seen to have any provision for turning anti-aliasing off or setting the ppi.
Maybe open the file, apply the threshold filter to remove anti-aliasing, export as png

Also depends on the PDF. Is it pure text or pure text with graphics or something else?

Forum Jump: