aaronhoffman Posted July 29, 2009 Share Posted July 29, 2009 Is there a way "Extract" a drop shadow in Paint.net? For example: I have a Gradient that is from Black to White. It represents a Drop Shadow on top of a White Background, (All in one layer. no transparency. kinda like if the Drop Shadow was "flattened", or you took a "Print Screen" of it). (left half of attached image) How would you Convert that to a Gradient that is from Black to Transparent? Basically I want to replace White, and any level of "white" within the image, with that same level of Transparency. (right half of attached image) Color Crosswalk: Initial color -- post-extract color (RRR-GGG-BBB-AAA) -- (RRR-GGG-BBB-AAA) 000-000-000-255 -- 000-000-000-255 (black stays black) 093-093-093-255 -- 000-000-000-163 (black, but a little bit transparent) 212-212-212-255 -- 000-000-000-044 (black, a little more transparent) 255-255-255-255 -- 000-000-000-000 (white turns into black, fully transparent) Thank You, Aaron Quote Link to comment Share on other sites More sharing options...
Ash Posted July 29, 2009 Share Posted July 29, 2009 Color to Alpha plugin. Uncheck Hue and Saturation, Try setting Brightness, Keep From @ 0, and slide To. And you also have to adjust the Feather, if you don't, you won't get the gradient, you only get a hard edge. Trial and error, you will get it. Quote All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ] Link to comment Share on other sites More sharing options...
BoltBait Posted July 29, 2009 Share Posted July 29, 2009 Here is a CodeLab script to do what you want: #region UICode byte Amount1 = 0; // [1] Delete|White|Black #endregion private UnaryPixelOps.Desaturate desaturateOp = new UnaryPixelOps.Desaturate(); void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra CurrentPixel; for (int y = rect.Top; y { for (int x = rect.Left; x { CurrentPixel = desaturateOp.Apply(src[x,y]); switch (Amount1) { case 0: CurrentPixel.A = (byte)(255-CurrentPixel.R); CurrentPixel.R = 0; CurrentPixel.G = 0; CurrentPixel.B = 0; break; case 1: CurrentPixel.A = CurrentPixel.R; CurrentPixel.R = 255; CurrentPixel.G = 255; CurrentPixel.B = 255; break; } dst[x,y] = CurrentPixel; } } } Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
aaronhoffman Posted August 2, 2009 Author Share Posted August 2, 2009 Thanks Ash, I feel like "Color to Alpha" should work as well. But I just can't seem to get it to work. Thanks BoltBait, that code worked perfectly. (CodeLab Plugin required http://www.boltbait.com/pdn/codelab/ ) 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.