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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
akratz
Posts: 2
Joined: 2018-10-18T12:09:50-07:00
Authentication code: 1152

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
akratz
Posts: 2
Joined: 2018-10-18T12:09:50-07:00
Authentication code: 1152

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
Post Reply