Posted By

deepsoul on 11/01/09


replace colour color

Versions (?)

Replace background colour

 / Published in: Bash


When you put an image in a printable document, you don't want it to have black (or coloured) background. ImageMagick allows to replace colours even when the coloured regions are non-contiguous. Arbitrary colour values can be specified with \#123456 (the backslash is for escaping the #). If you want to replace similar colours as well, use the -fuzz option.

  1. convert blackbackground.png -fill white -opaque black whitebackground.png
  2. convert bluebackground.png -fill white -opaque \#200070 whitebackground.png

Report this snippet  

You need to login to post a comment.