My grain of sand...
In after effects you could use "remove color matting" effect. It has a option to select the rigth color.
We use it a lot to correct image sequences with wrong alphas and works remarkably well.
You would not belive the kinds of images with messed up alpha channel must fix at work.
I belive in photoshop there is something similar. Defringe, if i recall correctly but doesnt work as well as After effects one.
Copy pasta:
"Color matting occurs when the edge of an object within a transparent layer that contains a premultiplied RGB channel retains the color from its original background instead of blending partially transparent areas with the new background. This produces a halo, or "color matting," effect around the outside edge of objects. To remove this color matting effect, you'll need to use the "Remove Color Matting" option on the video channel.
I guess the magic term to search in google is "color matting", it took me a while to find out, now you know it in 10 seconds.