Code: Select all
mogrify -path results -resize 1440x900^< -extent 1440x900^< -background black -gravity center -quality 95 *.jpg
PAUSE
Code: Select all
mogrify -path results -resize 1440x900^< -extent 1440x900^< -background black -gravity center -quality 95 *.jpg
PAUSE
Code: Select all
-extent "%[fx:w<1440?1440:w]x%[fx:h<900?900:h]"
My testing seems to indicate that "mogrify" isn't compatible with FX expressions, so I'd probably run the process as a "for" loop using "magick" instead of "mogrify". Something like this in a BAT script should do pretty much what you're trying to accomplish...TheBladeRoden wrote: ↑2017-09-25T08:07:42-07:00I figured out how to enlarge only pictures that are smaller than 1440x900, but the same technique doesn't work for extent (i.e. it will clip a 1600x1080 picture down to 1440x900 instead of leaving it alone).
Code: Select all
for %%I in ( *.jpg ) do (
magick "%%I" -set filename: "%%[t]" -resize 1440x900^< -gravity center ^
-background black -extent "%%[fx:max(w,1440)]x%%[fx:max(h,900)]" "result\%%[filename:].jpg"
)
Hey that worked out pretty well, thanks!GeeMack wrote: ↑2017-09-25T08:41:45-07:00My testing seems to indicate that "mogrify" isn't compatible with FX expressions, so I'd probably run the process as a "for" loop using "magick" instead of "mogrify". Something like this in a BAT script should do pretty much what you're trying to accomplish...TheBladeRoden wrote: ↑2017-09-25T08:07:42-07:00I figured out how to enlarge only pictures that are smaller than 1440x900, but the same technique doesn't work for extent (i.e. it will clip a 1600x1080 picture down to 1440x900 instead of leaving it alone).
Code: Select all
for %%I in ( *.jpg ) do ( magick "%%I" -set filename: "%%[t]" -resize 1440x900^< -gravity center ^ -background black -extent "%%[fx:max(w,1440)]x%%[fx:max(h,900)]" "result\%%[filename:].jpg" )