Reptillian Posted June 17, 2018 Share Posted June 17, 2018 (edited) Looking for quick searches, I am not looking at any plugins that will allow me to convert a color to black and white to the following : Lightness based on the HSL model (Can't be done with gradient map reliably. Close sometimes, but not always) Luminosity (Default Black and White) (Looks close to ITU-R BT.709) Value(Not sure) Average of Channel (Not possible) Min Channel (Not possible) Max Channel (Not possible) The issue with the current one is that I need Lightness based on the HSL model, and Paint.NET has yet to have a plugin like that. And this raises another question. Why is luminosity on the default black and white different than luminosity in plugins? In plugins, it's using the HSL *L. Edited June 17, 2018 by Reptillian Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
MJW Posted June 18, 2018 Share Posted June 18, 2018 Black and White+ should meet most of your grayscale needs. As I understand them, the V in HSV is the max channel; the L in HSL is the average of the min and max channels. Quote Link to comment Share on other sites More sharing options...
Reptillian Posted June 18, 2018 Author Share Posted June 18, 2018 (edited) I'm more interested into selecting one of those option, and then the hypothetical plugins leads me to one of those result.Tried the Black and White+, but the sliders aren't exactly what I want to be seeing. There is an application where I use pixel sort to figure out gradient mapping of a image which involves applying grayscale operation to figure out how it was mapped. Some people use luminosity to map, and other use lightness, and sometimes people use one of the channel to map. Edited June 18, 2018 by Reptillian Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
MJW Posted June 18, 2018 Share Posted June 18, 2018 Sorry it doesn't do what you want to do. Hope you find something that does.. Quote Link to comment Share on other sites More sharing options...
Reptillian Posted June 18, 2018 Author Share Posted June 18, 2018 Actually, I guess this is something I can code now to try to understand more about coding in general to improve on open source projects. C# is the programming language for Paint.NET right? I'm more accustomed to C++. Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
MJW Posted June 18, 2018 Share Posted June 18, 2018 Yes, C# is the Paint.NET programming language. Strictly speaking, any managed .NET language, such as C++/CLI, will work for writing plugins, but virtually every plugin is written in C#. I vaguely recall there were some plugins written in Visual Basic. Anyone who knows C++ should have no problem writing C#. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted June 18, 2018 Share Posted June 18, 2018 Getting a copy of Codelab is your easiest intro to plugin writing. Here's something to get you started: /* ================================================================================= */ /* */ /* Intensity Map.cs */ /* (c) 2010 Ego Eram Reputo */ /* */ /* Description: Converts the selection/image into an intensity (greyscale) map */ /* */ /* ================================================================================= */ // Name: Intensity Map // Author: Ego Eram Reputo // Submenu: Color // URL: http://www.getpaint.net/redirect/plugins.html // Title: Intensity Map - 2010 Ego Eram Reputo void Render(Surface dst, Surface src, Rectangle rect) { Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt(); byte v = 0; ColorBgra CurrentPixel; for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; v = Intensity(CurrentPixel); CurrentPixel = ColorBgra.FromBgra(v,v,v,255); dst[x,y] = CurrentPixel; } } } // *************** Intensity Method *************** // // Returns the intensity (byte) of the source color. Over a fully opaque image, this functions as Advanced Desaturate. // // Exceedingly bright = intensity of 255. // Very, very dim = intensity of 0. // A partially transparent pixel should be less intense than the same pixel if it was fully opaque. // // Initially... (R + G + B)/3 * A / 255 // // Exponential scaling of Alpha channel better deals with partial transparency. // So an Alpha value < 255 increasingly biases the resultant intensity towards zero...., // // (R + G + B)/3 * (A * A) / (255*255) // // The RGB channels themselves have different intensities, so scaling these yields an // even better result, which is slightly brighter than the previous formula...., // // (scaled.R + scaled.G + scaled.B) * (A * A) / (255*255) // // Lambda Expression: Not working in codelab? // Func<ColorBgra, byte> Intensity = iColor => (iColor.R + iColor.G + iColor.B) * iColor.A * iColor.A / 195075; private byte Intensity(ColorBgra iColor) { byte Intensity = 0; // Intensity = (byte)((iColor.R + iColor.G + iColor.B) * iColor.A / 765 ); // first formula // Intensity = (byte)((iColor.R + iColor.G + iColor.B) * iColor.A * iColor.A / 195075 ); second formula Intensity = (byte)(( (iColor.R * 0.299) + (iColor.G * 0.587) + (iColor.B * 0.114)) * iColor.A * iColor.A / 65025 ); return Intensity; } // ************* Intensity Method Ends ************ 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...
Ed Harvey Posted June 19, 2018 Share Posted June 19, 2018 "Extract Channel" in my plugins (Ed Harvey Effects v 4.0) has quite a range of selections... ? 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.