Please someone help me

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
zombie_nation

Please someone help me

Post 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?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Please someone help me

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Please someone help me

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply