Xiard Posted January 2, 2016 Share Posted January 2, 2016 I have various images that need to be made monochromatic (icons for an app). The original image has anti-aliasing, so there are lots of translucent pixels on the borders of the lines. It is very, very difficult to tell the difference visually between a pixel that is completely transparent and one that is 99% transparent. The only values I can use for pixels in the image are #00000000 (completely transparent) and #FFFFFFFF (fully opaque white). Any pixels of any other value causes the image to be rejected. Is there any effect I can apply or process I can go through to make all pixels that are mostly transparent become completely transparent, while pixels above a threshold become completely opaque white? Quote Link to comment Share on other sites More sharing options...
Red ochre Posted January 2, 2016 Share Posted January 2, 2016 http://forums.getpaint.net/index.php?/topic/25193-alpha-threshold-new-plugin-16th-aug-2012/ Hope that helps Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Xiard Posted January 2, 2016 Author Share Posted January 2, 2016 Great! Thanks! Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted January 3, 2016 Share Posted January 3, 2016 (edited) Edit: ...great... I didn't see the other thread... Run this in CodeLab. Pixels that have an opacity of 50% or less will be made completely transparent. Pixels over 50% will be made solid (100% opacity) white. void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra CurrentPixel; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; if (CurrentPixel.A < 128) { CurrentPixel.A = 0; } else { CurrentPixel = Color.White; } dst[x,y] = CurrentPixel; } } } Edited January 3, 2016 by toe_head2001 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Red ochre Posted January 3, 2016 Share Posted January 3, 2016 AlphaThreshold doesn't change the AA'd pixels to white so your contribution may not be in vain. Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 3, 2016 Share Posted January 3, 2016 Duplicate threads merged. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Rick Brewster Posted January 4, 2016 Share Posted January 4, 2016 Another way to achieve a monochromatic effect is to use Adjustments -> Black & White followed by Adjustments -> Posterize, and set the sliders to the minimum value (2). Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html 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.