Converting images using imagemagic in DOS

This forum is devoted to showing off and discussing open source and free software we use and/or think is worth while. If you're looking for software, post your need here and we'll make a suggestion.

Moderator: forhire

Converting images using imagemagic in DOS

Postby forhire » Thu May 06, 2010 7:17 pm

Something it easier to do something as a batch. Normally I'd do this kind of stuff in bash... but today I was on a Windows machine so...

First I had a bunch of files with double extensions. Why do it by hand when a one liner will fix it right up:

for %f in (*.jpg.jpg) do ren %f %~nf

Next I re-sized them all using convert with this one liner. The '^>' is an escaped greater than telling convert to only fiddle with the larger images.

for %f in (*.jpg) do convert.exe -resize 400x400^> %f resized/%f
forhire
Site Admin
 
Posts: 376
Joined: Thu Jun 24, 2004 7:56 pm
Location: Morton, Washington

Return to Open Source Software

Who is online

Users browsing this forum: No registered users and 9 guests

cron