Page 1 of 1

Resizing images based upon overall resolution

Posted: 2009-02-26T19:08:04-07:00
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

Re: Resizing images based upon overall resolution

Posted: 2009-02-26T19:27:46-07:00
by fmw42
use the area resizing symbol @ in your -resize

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