Tango Posted February 14, 2017 Share Posted February 14, 2017 Background: I have been using Windows Live Photo Gallery (WLPG) for most of my simple photo editing as it has everything I need for global editing (no layers, no selecting portions of an image for editing). Have recently started using Paint.net (PN) for more complicated tasks. Problem: Have been able to find the equivalent of most of WLPG features in PN, with the notable exception of Color Temperature adjustment. Sure, I could play around with Level, Curves, Hue/Saturation and finally get what I want (and then some), but very often, a single-slider Color Temperature control is all I need to add back some warmth in skin tones in a photo taken with a flash, for example, or remove some in a photo taken with indoor (tungsten) light. Questions: (1) What is the simplest way to achieve that with built-in PN features? (2) Is there a recommended Plugin that will make it even simpler? Thanks! Quote Link to comment Share on other sites More sharing options...
BoltBait Posted February 14, 2017 Share Posted February 14, 2017 Here is a CodeLab script to do what you want: // Name: Temperature/Tint // Submenu: Photo // Author: BoltBait // Title: BoltBait's Temperature/Tint v1.1 // Version: 1.1 // Desc: Adjust the Temperature or Tint of a photograph // Keywords: Temperature|Tint // URL: http://BoltBait.com/pdn #region UICode IntSliderControl Amount1 = 0; // [-100,100] Temperature IntSliderControl Amount2 = 0; // [-100,100] Tint CheckboxControl Amount3 = false; // [0,1] Preview original image #endregion private byte Clamp2Byte(int iValue) { if (iValue<0) return 0; if (iValue>255) return 255; return (byte)iValue; } void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra CurrentPixel; for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; for (int x = rect.Left; x < rect.Right; x++) { CurrentPixel = src[x,y]; if (!Amount3) { CurrentPixel.G = Clamp2Byte(CurrentPixel.G + Amount2); // Tint CurrentPixel.R = Clamp2Byte(CurrentPixel.R + Amount1); // Temperature CurrentPixel.B = Clamp2Byte(CurrentPixel.B - Amount1); // Temperature } dst[x,y] = CurrentPixel; } } } 2 Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Eli Posted February 14, 2017 Share Posted February 14, 2017 2 hours ago, BoltBait said: Here is the compiled effect: Thanks for this tool BoltBait, Quote Link to comment Share on other sites More sharing options...
Tango Posted February 14, 2017 Author Share Posted February 14, 2017 Thanks BoltBait, but the effect isn't what the Color Temperature control in WLPG does (and it doesn't have the desired effect in actual use either). You're increasing red and decreasing blue for "warmer," and the reverse for "cooler," but what WLPG does is not quite as simple. E.g., it is asymmetric (warmer and cooler are not the inverse of each other) and non-linear (intensity of adjustment of R/G/B are not linear with level of warming/cooler applied). There is even some (but very small) cross-correlation between what the level of one channel is to the effect of adjustment on the other channel (but it's so small that probably this can be ignored). I did some tests with 25%, 50% and 75% grey to come up with the above conclusions once I saw that BoltBait's script wasn't doing the same thing (and one with 75% R, 50% G, 25% B to check the cross-correlation) and here is the result (converted to image). I suppose one could come up with more intermediate points and come up with a heuristic curve that emulates the WLPG filter. Probably could improve upon it too since I sometimes need more than the max amount provided by WLPG and the additional range could be incorporated. I got curious and searched for a research paper on what such an equation might actually be (R, G and B levels as a function of desired color temperature adjustment). It must surely exist but I couldn't come up with it, at least not with a casual Google search. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted February 14, 2017 Share Posted February 14, 2017 This is where I found the algorithm that I used: http://www.tannerhelland.com/5675/simple-algorithms-adjusting-image-temperature-tint/ Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
BoltBait Posted February 14, 2017 Share Posted February 14, 2017 My mistake! There was a bug in the compiled code but not in the script shown above. Here is a corrected dll (version 1.1): <snip> Hope this helps! BTW, it is way more sensitive than your table above. So, instead of Gray 127 adjusting to 100, adjust to 19 or 20 instead. The numbers will still not come out perfect to your table, but should be close enough on a photograph that you shouldn't see a difference by eye. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Tango Posted February 14, 2017 Author Share Posted February 14, 2017 Indeed this one works with the colors changing as expected (notwithstanding apparently different algorithm used by WLPG)! And indeed more sensitive too, which solves my other problem. Thanks (and for the link too)!! May I suggest posting in the Plugins section, notwithstanding that it's simple? It's a pretty useful adjustment. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted February 14, 2017 Share Posted February 14, 2017 I will do that now that the bugs have been worked out. One last question for everyone: Should I move it from the Effects > Photo menu into the Adjustments menu? Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
IRON67 Posted February 14, 2017 Share Posted February 14, 2017 30 minutes ago, BoltBait said: Should I move it from the Effects > Photo menu into the Adjustments menu? I think YES, because it is not a special photo related effect. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted February 14, 2017 Share Posted February 14, 2017 I'd place it into the Adjustments menu. Don't forget to add some color decorations to those sliders. Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
BoltBait Posted February 15, 2017 Share Posted February 15, 2017 30 minutes ago, toe_head2001 said: Don't forget to add some color decorations to those sliders. Of course. And, I'll switch over to pointers, add a help file, etc. when I do the rebuild tonight. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted February 15, 2017 Share Posted February 15, 2017 I'm going to vote for Effects > Photo. It seems a plugin which you would primarily use on ......photos! 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...
BoltBait Posted February 15, 2017 Share Posted February 15, 2017 OK, here is the final build, please test: http://forums.getpaint.net/index.php?/topic/111031-temperature-tint-adjustment/ Located in the Effects > Photo menu. 5 Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
lynxster4 Posted February 15, 2017 Share Posted February 15, 2017 Works very well. Thank you, @BoltBait! 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...
Pixey Posted February 15, 2017 Share Posted February 15, 2017 Ooooooooo - @BoltBait looking so dapper . Quote How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon. Link to comment Share on other sites More sharing options...
Tango Posted February 15, 2017 Author Share Posted February 15, 2017 Yes, works great. Thanks again. Since you ask, for me it clearly belongs in the Adjustments menu since the similar linear color modifications like Hue/Saturation are there, and it is intended to correct an image, not add an artifact. Effects seem to have, appropriately, mostly enhancements to add effects not in the original picture (with the notable exception of Red Eye, but that is a non-linear adjustment at least). Either way, it's a minor point, just happy to have it. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted February 15, 2017 Share Posted February 15, 2017 3 hours ago, Pixey said: Ooooooooo - @BoltBait looking so dapper . I dressed up and even colored my hair/beard for my daughter's wedding. 1 Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
LionsDragon Posted February 15, 2017 Share Posted February 15, 2017 Perfect timing @BoltBait! I'm polishing up some pictures for my husband's godson's confirmation, and some of the photos needed this badly. It works great! Thank you! Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted February 15, 2017 Share Posted February 15, 2017 @BoltBait - are you going to release this in it's own thread? Please do so we can keep track of it. 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...
BoltBait Posted February 15, 2017 Share Posted February 15, 2017 13 minutes ago, Ego Eram Reputo said: @BoltBait - are you going to release this in it's own thread? Please do so we can keep track of it. Yes, I just want to iron out any last minute bugs. It looks pretty good now, I think the last thing is to decide which menu to put it in. Once that's done, I'll publish. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
dipstick Posted February 15, 2017 Share Posted February 15, 2017 I think you should put it in your "Combined Adjustments" plugin replacing the Yellow/Blue adjustment slider. Just a thought. It works great in PDN 4.0.13, it doesn't work in PDN 3.5.11. 1 Quote Link to comment Share on other sites More sharing options...
BoltBait Posted February 15, 2017 Share Posted February 15, 2017 9 hours ago, dipstick said: I think you should put it in your "Combined Adjustments" plugin replacing the Yellow/Blue adjustment slider. Just a thought. It works great in PDN 4.0.13, it doesn't work in PDN 3.5.11. Now, there's the best idea in the thread. EDIT: Done! Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game 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.