toe_head2001 Posted October 2, 2017 Share Posted October 2, 2017 (edited) Green Tint Reduction Effects -> Photo -> Green Tint Reduction Description Reduce green tint without introducing Magenta. Technical Description When reducing the Green channel to a reasonable amount, parts of a photo can became Magenta. I wrote a script to check for Magenta's Hue range. That worked, but it had the side-effect of Reds becoming desaturated. Therefore, I also had it check the Saturation amount within that Hue range. Instructions Set the Tint Reduction, and then lower the Red Tolerance as needed. Afterwards, further color adjustment could done with Curves, Levels, ect. Examples Spoiler Before: After: Spoiler ---> See how the Red is preserved without adding Magenta into the photo? Change Log v1.0 (Oct 2, 2017) Initial release Download GreenTintReduction.zip Source Code Spoiler <--- Icon // Name: Green Tint Reduction // Submenu: Photo // Author: toe_head2001 // Title: // Version: 1.0 // Desc: Reduce green tint without introducing Magenta. // Keywords: photo|tint|green // URL: // Help: #region UICode IntSliderControl Amount1 = 80; // [0,128] Tint Reduction IntSliderControl Amount2 = 50; // [0,100] Red Tolerance #endregion void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra CurrentPixel; HsvColor hsvEval; byte originalGreen; 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]; originalGreen = CurrentPixel.G; CurrentPixel.G = Int32Util.ClampToByte(originalGreen - Amount1); hsvEval = HsvColor.FromColor(CurrentPixel); while ((hsvEval.Hue > 250 || hsvEval.Hue < 30) && hsvEval.Saturation < Amount2) { if (CurrentPixel.G == originalGreen) break; CurrentPixel.G++; hsvEval = HsvColor.FromColor(CurrentPixel); } dst[x,y] = CurrentPixel; } } } Icon based on an icon from Fugue. Edited May 19, 2020 by toe_head2001 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab 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.