Page 1 of 1
-density not working properly
Posted: 2010-01-20T20:05:10-07:00
by Andon
I am not sure if I'm doing something wrong or if ImageMagick is borked, but regardless of how I use the -density command, it doesn't seem to work properly.
Using the following:
Code: Select all
convert -size 1006x720 xc:transparent -pointsize 16 -density 290.286 -draw "text 35,70 'test'" test_text.png
produces text of the proper size and an image of the proper size, but when I open the image in GIMP, it reads it as 72 DPI.
Is this something my end?
Re: -density not working properly
Posted: 2010-01-21T15:35:16-07:00
by el_supremo
I tried your command and then did:
which reports, amongst other things:
Code: Select all
Resolution: 290x290
Units: Undefined
If you mean pixels per inch you should do:
Code: Select all
convert -size 1006x720 xc:transparent -pointsize 16 -units pixelsperinch -density 290.286 -draw "text 35,70 'test'" test_text.png
but note that the PNG specification only allows for pixels per centimetre and IM will convert 290.286 ppi to 114.28 ppcm.
Pete
Re: -density not working properly
Posted: 2010-01-21T15:45:31-07:00
by Andon
Alright, thanks. I was looking through the documentation - not really reading too much - and there was no -units thing that I had seen, so I just figured that it was just ppi. I'd actually prefer to use ppcm - so rather than -units pixelsperinch it'd be -units pixelspercentimeter ?
Re: -density not working properly
Posted: 2010-01-21T17:49:10-07:00
by el_supremo
so rather than -units pixelsperinch it'd be -units pixelspercentimeter ?
Yes.
Pete
Re: -density not working properly
Posted: 2010-01-21T17:55:05-07:00
by fmw42
Re: -density not working properly
Posted: 2010-01-21T22:34:03-07:00
by Andon
Awesome guys. Got around to doing this just now, and it works perfectly. Thanks a lot