How to bulk remove white background from a picture

How to bulk remove white background from a picture

To remove a white background from multiple images at the same time you can use the ImageMagick convert command which is a command line utility. You can install ImageMagick on any platform (ie... Windows, Mac, Linux, iOS) and open a command prompt to run the following command to convert multiple images in a directory to a transparent background from another solid color. For this example we're converting .jpg files to .png files and going from a white background to a transparent background but you can change the command line below to fit your needs:

find . -type f -name "*.jpg" -print0 | while IFS= read -r -d $'\0' file; do convert -verbose "$file" -transparent white "$file.png"; done

Another example might be converting a gif to a png (we choose png because it supports transparency) and changing a green background to a transparent background:

find . -type f -name "*.gif" -print0 | while IFS= read -r -d $'\0' file; do convert -verbose "$file" -transparent green "$file.png"; done

Also, you might not want to change to transparent, perhaps you'd like to change a green background to blue:

find . -type f -name "*.jpg" -print0 | while IFS= read -r -d $'\0' file; do convert -verbose "$file" blue green "$file.png"; done

 

Comments


Boise Web Design

Established in the City of Trees in Boise Idaho in 2002, Vector Network Solutions is now a leading web development company providing Boise web design with over ten years of experience. Leading the way with a proven track record on the industries top web platforms, VectorNS is capable of delivering exceptional solutions to clients around the globe. Our strategic methods afford us the ability to provide Boise with web design, development and a sharp competitive edge. Call or e-mail today to start initiating your project with the experienced professionals at VectorNS.

Free Web Tips & Ideas!

Sign up for VectorNS Web Tips and recieve occasional tips & ideas to enhance your web presence.