This script removes the background from a PNG file. Specify the input PNG file path, the output PNG file path, and the RGB value for which background colour to remove. It sets all pixels that match that exact RGB value (and any opacity) to an RGB value of 0,0,0 and an opacity of 0. Any pixels that had even a slightly different colour are untouched.
If you find a bug feel free to drop a comment below and I'll see if I can fix it.