Imagemagick Transparent
A quick tutorial on using Imagemagick to remove a background colour from images. The image file format needs to support transparency e.g. PNG.
NOTE: JPG doesnt support transparency, so it would be necessary to convert the file.
Remove background color
- Set the input file
1input="old-white.png"
- Set the output file
1output="new-image.png"
- Set the background color to remove
1background_color="white"
- Set the background to transparent and remove the colour white
1convert $input -transparent $background_color $output
In the above the input image has a white background.
Use Imagemagick
to remove the white from the input image.
The resulting image is written to the output file.