|
![](/i/fill.gif) |
Chris Huff wrote:
>
> How about a filter that can take either 2 or 4 colors, if 2 colors, then
> it would adjust the colors of the image so the brightest is equal to the
> second color and the dimmest equal to the first.
Problem is you don't know the hue of the brightest/darkest pixel. That's why
I'm suggesting the bright/dark_tint. If the [darkest, brightest] colour is
[<.05,.1,.15>,<.9,.95,1>] and you simply set them to [<0,0,.05>,<1,.95,1>] it
will scale the rgb values differently. Although this might be useful, it will
almost certainly produce a tinted image.
"Auto Levels" in Photoshop does not preserve the hues of the darkest/brightest
pixel. It takes each colour component and scales them seperately, producing
[darkest, brightest] = [0,1], which IMHO is no good.
To get both these capabilities you could add keywords such as "absolute" and
"relative".
levels{ <dark>, <bright> relative}
If the brightest is <.9,.95,.93> the new value will be:
<.9,.95,.93>/.95*bright
If the darkest is <.1,.2,.3> the new value will be:
<0,.2,.3>*(1-.1)*dark
(Not sure of the math here. Idea is that 0.1->0 represents a 10% brightness
change)
levels{ <dark>, <bright> absolute}
If the brightest is <.9,.95,.93> the new value will be:
bright
If the darkest is <.1,.2,.3> the new value will be:
dark
sig.
Post a reply to this message
|
![](/i/fill.gif) |