Page 1 of 1

[convert] -density does not seem to have any effect

Posted: 2018-10-18T12:15:36-07:00
by akratz
I am using Version: ImageMagick 6.8.9-9 Q16 x86_64 2018-09-28 under Xubuntu 16.04.

I have been using ImageMagick for a few years and never had a problem.

However, recently the -density parameter does not seem to have any effect whatsoever.

I typically use convert like this:

Code: Select all

convert -density 1600 foo.pdf foo.png
Now, I always get very small PNGs, and regardless what values I enter for density, I always get the same (small) size PNGs. This seems to be the case regardless which PDF I use for input. I tried many, generated from different sources. By "small" I mean the x/y extenstion of the PNG in pixels, not the file size.

This is my problem. There was another problem, which I solved, which I mention here only in case it might be related: I could not use convert anymore because I was getting the "not authorized" error. I solved this by following the instructions here:
https://stackoverflow.com/questions/429 ... dimage-453
This problem has been solved. But it my problem with density not working is still there. Please help.

Re: [convert] -density does not seem to have any effect

Posted: 2018-10-18T12:45:46-07:00
by fmw42
What is your version of Ghostscript? Perhaps that needs upgrading or downgrading. Please post an example of a PDF that fails for you.

You should be able to get the GS version from:

Code: Select all

gs --version
at a terminal window

Try specifying the units also

Code: Select all

convert -units pixelsperinch -density 1600 foo.pdf foo.png

Re: [convert] -density does not seem to have any effect

Posted: 2018-10-18T13:54:50-07:00
by akratz
Sorry, I want to retract my question, I got it working now in the meanwhile - reason was wrong position of the density parameter. Sorry for the noise.

Re: [convert] -density does not seem to have any effect

Posted: 2018-10-18T16:37:56-07:00
by fmw42
For PDF files, you need to put the density before reading the PDF file.

Code: Select all

convert -units pixelsperinch -density 1600 foo.pdf foo.png