Using imagemagick, I'm looking to add an expanded background color to an image. My source looks like this:
And this is the desired output (the background color will be white, but this is for clarity):
Step 1 seems to be filling the background with my desired color, but I can't find a way to remove the background outside the shape. This will also be a problem if the source image contains any of the desired background color already (because it will be made transparent).
Ideas?