MJW Posted September 27, 2017 Share Posted September 27, 2017 Transparent to Transparent Black is an utterly trivial Adjustment that changes all the transparent pixels to transparent black (0, 0, 0, 0). It can sometimes be useful, particularly when using the Texture Merger. DLL, Version 1.0: TransparentToTransparentBlack.zip The code: Spoiler // Name: Transparent to Transparent Black // Submenu: // Author: MJW // Title: Transparent to Transparent Black // Version: 1.0 // Desc: Change color transparent pixels to black. // Keywords: transparent black // URL: // Help: #region UICode #endregion ColorBgra TransparentBlack = ColorBgra.FromBgra(0, 0, 0, 0); void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra pixel; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { pixel = src[x, y]; if (pixel.A == 0) pixel = TransparentBlack; dst[x, y] = pixel; } } } 1 2 Quote Link to comment Share on other sites More sharing options...
lynxster4 Posted September 28, 2017 Share Posted September 28, 2017 Mmmm.....could you post an example of what you mean? Thanks, @MJW! Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
MJW Posted September 28, 2017 Author Share Posted September 28, 2017 No example I post would tell you much, since the only affected pixels are transparent. When you clear a selection with Erase Selection, PDN fills the region with pixels with 0 for alpha, and (255, 255, 255) for the RGB values. Some plugins will make pixels transparent by setting alpha to 0, but leaving the RGB values unchanged. The RGB values can be anything, since if alpha is 0, the pixel will be transparent. Sometimes the RGB value matters, though. For example, when using the Maximum merge mode in the Texture Merger, it's almost always best to have the RGB of transparent canvas pixels set to 0, which represents the minimum height-map height. (Transparent pixels with RGBs of (255, 255, 255) are at the maximum height, so they will always win out in the Maximum comparison over clipboard pixels.) This plugin just sets all the transparent pixel RGBs to the same value, (0, 0, 0). This is a really boring plugin that I wrote in response to the thread Setting and maintaining RGB values for zero-alpha pixels. Most people will have no need for it, but I decided to release it for those who might. 1 Quote Link to comment Share on other sites More sharing options...
lynxster4 Posted September 28, 2017 Share Posted September 28, 2017 Sometimes I use the eraser on a layer; then I apply a plugin effect and can see where I erased. Your plugin would remove traces of that? Am I understanding correctly? Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
MJW Posted September 28, 2017 Author Share Posted September 28, 2017 Unfortunately, I don't think it would help with that. If you can describe what happens in more detail (or provide an example), maybe I or someone else can figure out the cause. I suppose it could be due to the color values in the transparent pixels, depending on what plugins were used. Quote Link to comment Share on other sites More sharing options...
lynxster4 Posted September 28, 2017 Share Posted September 28, 2017 No, that's okay MJW. It hasn't happened in a while and I would never remember what plugin I was using. Thanks, though! Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" 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.