This plugin will take the brightness of the pixels in an image, and make them transparent based on the values from the GUI.
located in Effects > Transparency
It was created to take different exposure images and combine them into a sort of HDR image. It's pretty simple in concept so I'll give an example of how I use the plugin.
High, Mid, and Low exposure images:
On the high-exposure image, I make the bright pixels transparent so that I have detail in the dark areas. And on the low-exposure image, I make the dark pixels transparent so that I have detail in the bright areas. Then I merge those layers (just "Normal" layer blend mode) onto the mid-exposure image.
In the end, I have a photo with more dynamic range than what my basic phone camera could have gotten just on it's own.
Selective Transparency
in Plugins - Publishing ONLY!
Posted · Edited by Skysworld
This plugin will take the brightness of the pixels in an image, and make them transparent based on the values from the GUI.
located in Effects > Transparency
It was created to take different exposure images and combine them into a sort of HDR image. It's pretty simple in concept so I'll give an example of how I use the plugin.
High, Mid, and Low exposure images:
On the high-exposure image, I make the bright pixels transparent so that I have detail in the dark areas. And on the low-exposure image, I make the dark pixels transparent so that I have detail in the bright areas. Then I merge those layers (just "Normal" layer blend mode) onto the mid-exposure image.
In the end, I have a photo with more dynamic range than what my basic phone camera could have gotten just on it's own.
Download:
SelectiveTransparency.zip
CodeLabs Code:
// Name: Selective Transparency // Submenu: Transparency // Author: Skysworld // Title: Selective Transparency // Version: 1.0 // Desc: Make pixels transparent based on their brightness // Keywords: transparent|transparency // URL: https://forums.getpaint.net/profile/171721-skysworld/ // Help: https://forums.getpaint.net/profile/171721-skysworld/ #region UICode RadioButtonControl greatLess = 0; // Effect Pixels..|Greater Than|Less Than IntSliderControl intensity = 50; // [0,100,5] Brightness IntSliderControl thresh = 5; // [0,10] Threshold #endregion protected override void OnDispose(bool disposing) { if (disposing) { } base.OnDispose(disposing); } void PreRender(Surface dst, Surface src) { } void Render(Surface dst, Surface src, Rectangle rect) { //Loop through image's pixels for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { ColorBgra SrcPixel = src[x,y]; ColorBgra CurrentPixel; int newAlpha = SrcPixel.A; //===============Code Start=============== byte mostLumous; int pixelBrightness; mostLumous = SrcPixel.R; if (SrcPixel.G > mostLumous) { mostLumous = SrcPixel.G; } if (SrcPixel.B > mostLumous) { mostLumous = SrcPixel.B; } pixelBrightness = ((int)(mostLumous/2.55)); //===============Code Start=============== if (greatLess == 0) //Greater than { if (pixelBrightness > intensity) { newAlpha = (((int)SrcPixel.A) - Math.Abs(11-thresh)*((int)(pixelBrightness) - intensity)); if (newAlpha < 0) {newAlpha = 0;} } } else { //Less Than if (pixelBrightness < intensity) { newAlpha = (((int)SrcPixel.A) - Math.Abs(11-thresh)*(intensity - ((int)(pixelBrightness)))); if (newAlpha < 0) {newAlpha = 0;} } } //===============Code End=============== CurrentPixel = ColorBgra.FromBgra(SrcPixel.B, SrcPixel.G, SrcPixel.R, (byte)newAlpha); dst[x,y] = CurrentPixel; } } }