nikinikiniki Posted April 10, 2015 Share Posted April 10, 2015 Hello Paint.NET gurus! I've got two bmp files with white and grey backgrounds (see attach - white background and grey background layers). These pictures were actually made from a single picture (with transparency) and different background colors. I need to restore the original picture (with transparency). I've played around with alpha mask plugins but with no luck. Is there a way to make it work? Thanks in advance. backgrounds.pdn.zip Quote Link to comment Share on other sites More sharing options...
xod Posted April 10, 2015 Share Posted April 10, 2015 I'm not a Paint.NET guru but my advice is: Use MagicWand and gradually decrease tolerance then click in the background area and Cut. Undo and repeat this until you are satisfied with the result. There are other ways to get what you want, but that's the easiest. https://www.youtube.com/watch?v=ix9iCPseLFI 1 Quote Link to comment Share on other sites More sharing options...
Pixey Posted April 10, 2015 Share Posted April 10, 2015 I tried to do this earlier, with the magic wand on both layers, each with a different tolerance, but the outcome was awful as the images supplied by @nikini are so very small. I don't think it's possible with such minute images - but I could be wrong . 1 Quote How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon. Link to comment Share on other sites More sharing options...
nikinikiniki Posted April 10, 2015 Author Share Posted April 10, 2015 Thanks all for replies! Actually I've tried "magic wand" on these bmp files (they are 48x48 icons actually) but results look weird. Still I think there must be a technique (plugin or set of plugins) that can do the following: 1. We know that upper left pixel in image is "pure background pixel" - without any influence from "main" picture 2. Create a "mask" image so that each pixel color is "subtracted" from upper left pixel color. 3. Repeat previous steps on second image (with different "upper left pixel" color). 4. Somehow combine two masks and get real alpha mask (for one of initial bitmaps). 5. Apply this mask to one of initial bitmaps and restore original image with transparency Quote Link to comment Share on other sites More sharing options...
MJW Posted April 10, 2015 Share Posted April 10, 2015 (edited) One thing you should consider is that the images do not seem to have been produced by alpha blending an image against two different background colors. If you alpha blend the same image to two different background colors, the difference between the resulting images will be an essentially constant color, equal, for each BGR component, to (1 - alpha/255) * (background1 - background2). However, if you use difference blending on the two layers, the result is clearly not a single color. I tried this with an actual image, to make sure the difference blending works like I think it would, and the result was a constant color of the predicted shade. Had the images been produced with alpha blending, it would have been fairly easy to recover the original image. As you can see by the above formula, since the background colors are known, the value of alpha could be calculated from the difference of the images. (This part may not be true. Only the blended background color is known. I'll need to think about it some more.) Edited April 11, 2015 by MJW Quote Link to comment Share on other sites More sharing options...
Cc4FuzzyHuggles Posted April 12, 2015 Share Posted April 12, 2015 (edited) If you want to make a mask of your object, you can try this :1) Change the top layer's blending mode to Multiply. 2) Duplicate the top layer, name it Alpha Mask. 3) Duplicate the Alpha Mask layer, then merge that duplicate back down, so that you only have one Alpha Mask layer.4) Temporarily turn off the other two layers.5) Use the two-tone threshold plugin on the Alpha Mask layer to turn the object solid black and remove the background.Try these settings:Lo threshold 255Hi threshold 255Colors 1. black 2. transparent.Leave the rest of the settings default.Click Ok.If some parts of the object are not black, use the paint brush tool for touching things up.6) If you are successful at making your object into a mask, you can then use the mask with the alpha mask plugin on one of the other layers. (use the invert mask setting). If you need more help or have questions, feel free to ask. Edited April 12, 2015 by Cc4FuzzyHuggles Quote *~ Cc4FuzzyHuggles Gallery ~* Link to comment Share on other sites More sharing options...
Chin Rey Posted April 17, 2015 Share Posted April 17, 2015 I just logged on here to ask for tips about removing backgrund from a photo and found out you guys had answered even before I asked! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.