Manipulating image files by batch

Started by
11 comments, last by Servant of the Lord 9 years, 5 months ago

ImageMagick is what I've used for bulk scaling, cropping, format conversions, and others as well.

Command for converting BMP files to GIF files:

//Warning: Make sure you set your command-line's current directory to the directory (and sub-directories) you want to crawl before executing this command.
//Note: It won't delete the original BMP files, so you need to do that afterward - easy enough to do in Windows Explorer by searching for *.bmp and selecting all).
for /r %i in (*.bmp) do mogrify -format gif -transparent #FF0000 "%i"

Replace '#FF0000' with your actual background color. Make sure you have your current directory set - you don't want to crawl over your entire computer!

This is Windows command line command saying to recursively crawl the current directory, filtering by *.bmp and executing the command that follows, replacing %i with the filepath and filename.


for /r %i in (*.bmp) do

This is an ImageMagick command saying to change the file "%i" into a gif, and make "#FF000000" the transparent part of the gif.


mogrify -format gif -transparent #FF0000 "%i"

Thanks!

Advertisement

ImageMagick is what I've used for bulk scaling, cropping, format conversions, and others as well.

Command for converting BMP files to GIF files:

//Warning: Make sure you set your command-line's current directory to the directory (and sub-directories) you want to crawl before executing this command.
//Note: It won't delete the original BMP files, so you need to do that afterward - easy enough to do in Windows Explorer by searching for *.bmp and selecting all).
for /r %i in (*.bmp) do mogrify -format gif -transparent #FF0000 "%i"

Replace '#FF0000' with your actual background color. Make sure you have your current directory set - you don't want to crawl over your entire computer!

This is Windows command line command saying to recursively crawl the current directory, filtering by *.bmp and executing the command that follows, replacing %i with the filepath and filename.


for /r %i in (*.bmp) do

This is an ImageMagick command saying to change the file "%i" into a gif, and make "#FF000000" the transparent part of the gif.


mogrify -format gif -transparent #FF0000 "%i"

This easily saved me a hundred hours of manual work!

Glad it helped! smile.png

ImageMagick has saved me loads of manual labor as well.

This topic is closed to new replies.

Advertisement