well are you going to explain them
it's hard to explain but in photoshop i make a square in the specific colour, rasterize the square for the background, trim the image i'm putting in it, drag a selection box around it, make the selection non-trans pixels only, and trim the background with the selection from the other layer