Intrepidis Posted July 21 Share Posted July 21 (edited) Invert Luminance This is a Paint.net plugin that can be found in the 'Adjustments' menu. It is mainly for inverting an image while keeping the hues unchanged; although it can also be used to adjust the luminance without doing any inversion. The reason why I created this plugin is because I used to use the regular "Invert Colors" adjustment and then "Hue / Saturation" to rotate the hue 180 degrees (in order to make the bright parts of images dark and vice-versa, while keeping the same colors) but it never looked too good. One day I decided to analyse why and realized it's because the maximum of the green channel (in an RGB image) actually looks brighter than the maximum possible of red. Of course, the maximum brightness of the blue channel is the dimmest of all in comparison. Using this plugin to invert the luminance of an image will keep the hues constant; but it will also keep the brightness of the red and blue channels relative to the brightness of green. The balance of green to red & blue is configurable, with the defaults being what I think visually looks the best (which may not be exactly accurate, as I only judged it by eye). Here's the download: https://dev.azure.com/intrepidis/Intrepidis PaintDotNet Plugins/_build/results?buildId=34&view=artifacts&pathAsName=false&type=publishedArtifacts Source code repository: https://dev.azure.com/intrepidis/_git/Intrepidis PaintDotNet Plugins The build pipeline: (maybe there's a newer version there) https://dev.azure.com/intrepidis/Intrepidis PaintDotNet Plugins/_build?definitionId=2&_a=summary Here's some before and after example images, and a screenshot of the options panel. This one shows how text inverted with this Plugin can look better than the old "Invert" and "Hue Rotate" method. Here's the options panel: When you go to the download link, you have to choose "Download artifacts" to get a zip of the files. Edited August 17 by Intrepidis Update the download link. 2 Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 21 Share Posted July 21 @Intrepidis cool stuff! A few notes and concerns: 1) These are classic effects that derive from [PropertyBased]Effect. Have you thought about converting them to the newer BitmapEffect or GpuEffect? The classic effect system is being deprecated soon and you won't be able to compile any new effects using that system. I/we can certainly help with this conversion over in Plugin Developer's Central. From what I can tell, these should be very well suited for converting to a [PropertyBased]GpuImageEffect using Direct2D's effect graph system and ComputeSharp.D2D1 pixel shaders. 2) In your source code repo you have copies of Paint.NET's DLL's (e.g. PaintDotNet.Base.dll). Paint.NET's license does not permit this, so you'll need to remove those. 1 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...
Intrepidis Posted July 22 Author Share Posted July 22 (edited) On 7/21/2024 at 8:41 PM, Rick Brewster said: @Intrepidis cool stuff! A few notes and concerns: 1) These are classic effects that derive from [PropertyBased]Effect. Have you thought about converting them to the newer BitmapEffect or GpuEffect? The classic effect system is being deprecated soon and you won't be able to compile any new effects using that system. I/we can certainly help with this conversion over in Plugin Developer's Central. From what I can tell, these should be very well suited for converting to a [PropertyBased]GpuImageEffect using Direct2D's effect graph system and ComputeSharp.D2D1 pixel shaders. 2) In your source code repo you have copies of Paint.NET's DLL's (e.g. PaintDotNet.Base.dll). Paint.NET's license does not permit this, so you'll need to remove those. 1) I don't know how to do this GPU thing. I'm just a guy who likes to do some art stuff when he gets a chance (which is rare). 2) Thanks for pointing that out! I dunno how I did that, but I will remove them. Edited July 28 by Intrepidis Change to not sound so snobbish, lol. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted July 22 Share Posted July 22 8 hours ago, Intrepidis said: I don't know how to do this GPU thing. Tutorials here: https://boltbait.com/pdn/CodeLab/help/tutorial/ Additional help here: https://forums.getpaint.net/forum/17-plugin-developers-central/ Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 23 Share Posted July 23 16 hours ago, Intrepidis said: 2) Thanks for pointing that out! I dunno how I did that, but I will remove them. Thanks! Also over here https://dev.azure.com/intrepidis/xBRZ/_git/xBRZ.NET?path=/Libs/PaintDotNet 1 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...
Intrepidis Posted August 4 Author Share Posted August 4 I've realized how I accidentally added the Libs folder... I did the ".gitignore" file wrong. That's corrected now too. 1 Quote Link to comment Share on other sites More sharing options...
Intrepidis Posted August 17 Author Share Posted August 17 I've just fixed a bug with absolute black (zero for each RGB channel). It was an infinity division by zero kind of thing. I've updated the OP with the new download link. 1 Quote Link to comment Share on other sites More sharing options...
Tactilis Posted August 17 Share Posted August 17 2 hours ago, Intrepidis said: I've updated the OP with the new download link. @Intrepidis When you post an update to a plugin, it's very helpful if you edit the thread title to add the date it was updated; you'll see this is done for many other plugins. That way, users of your plugin can easily see whether they need to re-download. Left click and hold for a few seconds in the title to activate editing. Quote Link to comment Share on other sites More sharing options...
lynxster4 Posted August 17 Share Posted August 17 @Intrepidis I just downloaded the updated plugin and the file and product version are the same as the old one (1.0.0.0) and so is the size. Is this the updated one? 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...
user.by Posted August 20 Share Posted August 20 Same version 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.