Page 1 of 1

Please someone help me

Posted: 2007-10-02T04:01:41-07:00
by zombie_nation
Hi guys,

Let me try and explain.
Using Imagemagick from the command line using PHP exec() functions to run a web app that can take a picture uploaded by users along with some text to annotate on the picture (sports cards for kids) that can then be printed for them to swap/collect etc.

As you can see I am dealing in 2 media - digital and print. aargghh.

I am trying to use IM to get the resolution set to a fixed limit (pref 150x150 dpi) and then -resize the image to get it to the correct dimensions. I am trying to handle all picture resolutions provided and funnel them into a fixed format of resolution and pixel size.

I have a few test images that I have created in Photoshop in 72dpi and 180 dpi. When I use -density the 72dpi will behave appropriately resolving up and down but the 180dpi image will not obey the commands and will continue to display at 180dpi.

Can anyone offer any suggestions?

The site is here: http://www.mysportscards.org for an explanation. I am still working on this on my development machine.

Also does IM automatically save images in 72dpi? If so, can I change this easily?

Re: Please someone help me

Posted: 2007-10-02T09:23:55-07:00
by Bonzo
Not 100% sure what you want but this will change the image dpi and resize it.

Code: Select all

convert input.jpg -density 150x150 -resize 300x300 output.jpg

Re: Please someone help me

Posted: 2007-10-02T20:58:59-07:00
by anthony
Bonzo, I think you mean -resample 300x300
That resizes the image according to change density, and sets the density to that give, such that the real world size does not change.

-resize just changes the pixel size only

-set density 300x300 just assigns a new density to the image, without chnaging the images pixel size.