I've been brainstorming trying to come up with a color adjustment tool concept someone could implement if they want to try.
The idea is to be able to selectively replace or tint colors in an image of a given luminance range in a simple and smooth manner.
Working theory so far is as follows:
Subject: “Image Gradient Color Shifter” or IGCS
A proposal for a new color adjustment tool.
Program Steps:
-In adjustments, Select IGCS
-Dialogue box with effect preview panel and configuration menus pops open
-Original Image placed in main preview panel. Thumbnail also placed in upper left corner to allow user to select and refer to image before any changes are made permanent for comparison. A side by side comparison option could also be available.
-Under the hood, image or layer is copied and desaturated to gray-scale, and placed in memory for reference.
-Luminance range of the gray-scale image is determined, and used to generate a gradient from the lightest to darkest value in the image.
-Each shade in the gray-scale image is mapped to the matching shades in the generated gradient.
-User then is allowed to change the gradient which changes the matching mapped shades in the gray-scale image accordingly.
-Special Note:
1. If the user chooses, a “shade locker” checkbox can be checked in order to limit color choices along the gradient to hues of the same shade only in order to maintain overall image luminance values if desired. True black or true white would not be changeable in this mode, but shades in-between would.
2. Un-checking this feature would allow the user to make similar adjustments to some Gradient Map tools, but still somewhat different due to how the gray-scale image and gradient are linked and the possibility of leaving some shade ranges in their original color if transparency is used in the gradient.
-As user makes changes to the gradient, changes are mapped back to the gray-scale image and applied. At this point, only changed pixels from the gray-scale image are copied to a third image with a transparent background and placed in a new layer on top of the original image in the preview pane and viewed as a composite image.
-An intensity slider will allow the transparency of the visible parts of the top image to be adjusted.
-For added flexibility, layer mix modes should be made available within IGCS to manipulate top layer if desired.
-The same options for changing the gradient as in the regular Gradient creation tool should also be included.
IGCS would be a color replacement/tinting tool for the whole image or selected portions based on image luminance values in an intelligent manner without the tediousness of replacing individual colors and depending on tolerance values to change what you want.
Please realize there may be more efficient ways to get the same result, this is just the way that popped into my head. I am not an expert programmer, I have never programmed anything more complicated than a very flexible virtual die roller... lol
These are just all ideas that I know are possible, and put together like puzzle pieces to get the desired result.
Right now I am trying to think of a way to mitigate possible color banding... Partha has suggested that maybe limiting the color palette to 8 or 16-bit might help.
Anyone interested is welcome to give input or experiment with programming a prototype. It's just a cool idea if it can be made to work.
Thank you for your interest
*Rod has suggested using blur to smooth transitions where color banding might occur. I believe this is an idea worth exploring, and seeing what results.
*To further clarify possibilities... Say you have a color image that contains both true white and true black for simplicity's sake... that would generate a gradient from white to black. Let's say that you want white left alone but you want the off whites to be tinted yellow blending into orange as they get a little darker. You also want the mid-tones left alone and the dark tones blending from a blue to a violet as the shades get darker with black staying black. In my original outline... if you have "Shade Locker" checked, true black and true white can not be changed, so that part is taken care of... next from left to right you adjust the shades in the gradient you would like to change in the image. To the right of white you would choose yellow then orange then a transparent/alpha then blue then violet (all selected colors being limited to colors of the same luminance value as the point in the gradient you are changing by the shade locker). After that, you would adjust the opacity to make it a tint rather than just replacing the colors which is what the proposed intensity slider is for.