Resizing images based upon overall resolution

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
Neurolysis

Resizing images based upon overall resolution

Post by Neurolysis »

Hi there!

Currently, I am running the following code to prepare images for use on Wikipedia (I run a bot, this script is called automatically).

Code: Select all

C:
del c:\DOCUME~1\Chris\Desktop\PNG\*.png /Q /F
del c:\DOCUME~1\Chris\NB\Done\*.png /Q /F
cd c:\Documents and Settings\Chris\NB\To do
mogrify -resize 450x450 *.*
xcopy c:\DOCUME~1\Chris\NB\TODO~1\* c:\DOCUME~1\Chris\NB\Done /I
del c:\DOCUME~1\Chris\NB\TODO~1\*.* /Q /F
xcopy c:\DOCUME~1\Chris\NB\Done\*.png c:\DOCUME~1\Chris\Desktop\PNG /I
cd c:\DOCUME~1\Chris\Desktop\PNG
optipng -o7 *.png
advpng -z4 *.png
sleep 10
xcopy c:\DOCUME~1\Chris\Desktop\PNG\*.png c:\DOCUME~1\Chris\NB\Done /I /R /Y
del c:\DOCUME~1\Chris\Desktop\PNG\*.png /Q /F
pause
Specifically, my issue is that people have now requested that instead of limiting the dimensions to 450px in any direction, I limit the overall amount of pixels (for example, limiting to 0.1 megapixels). I can't seem to find any documentation on this - is this function available using mogrify?

Thanks,

- Chris
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Resizing images based upon overall resolution

Post by fmw42 »

use the area resizing symbol @ in your -resize

see http://www.imagemagick.org/script/comma ... p#geometry
Post Reply