Jump to content
How to Install Plugins ×

Invert Luminance plugin


Recommended Posts

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.

 

example-1-lotus-blossom.webp.9807a1c4429ec730253296e7a57608c9.webp

 

example-2-garnem-jee.webp.dabb6e26824154d7b22d8c086d56c611.webp

This one shows how text inverted with this Plugin can look better than the old "Invert" and "Hue Rotate" method.

example-3-devops-repo.thumb.webp.0f496efccc5f222808316ce954ecfac4.webp

 

Here's the options panel:

example-4-options-panel.webp.fd6b3c8e05f8c0e120a1e0722e57e475.webp

 

When you go to the download link, you have to choose "Download artifacts" to get a zip of the files.

example-5-download-link.webp.12115ad13203362a7a6cb832048ee314.webp

 

Edited by Intrepidis
Update the download link.
  • Upvote 2
Link to comment
Share on other sites

@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.

  • Like 1

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Posted (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 by Intrepidis
Change to not sound so snobbish, lol.
Link to comment
Share on other sites

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 

  • Thanks 1

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 2 weeks later...
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.

Link to comment
Share on other sites

@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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...