POV-Ray : Newsgroups : povray.unofficial.patches : post_process suggestions? : Re: post_process suggestions? Server Time
2 Sep 2024 14:19:31 EDT (-0400)
  Re: post_process suggestions?  
From: Sigmund Kyrre Aas
Date: 1 May 2000 13:27:18
Message: <390DBE77.1197F13E@stud.ntnu.no>
Chris Huff wrote:
> 
> I guess I still don't get exactly what you mean...
> I would have the syntax be like this:
> levels {outMin, outMax, inMin, inMax}
> where outMin and outMax specify the range of the result(destination)
> colors, and inMin/inMax specify the range to take those values from. All
> 4 of these can be colors, but inMin and inMax are optional. If you don't
> specify them, it will "autorange", and calculate inMin as min(inR, inG,
> inB), and inMax as max(inR, inG, inB), and scale each color channel
> equally.

Could you elaborate with some pseudocode? How will you use outMin and outMax? 

If I understand you correctly you will set the colour with the highest/darkest
value of red, green, or blue to outMax/outMin. "Auto Levels" will then be equal
to levels{0,1}, right? If I apply this to an image with brightest pixel inMax:

inMax         outMax    change
<.9,.95,.8>   <1,1,1>   <1.11, 1.05, 1.13>

i.e. the channels will not be scaled equally unless you set outMax to 
<.9,.95,.8>/.95 = <.95,1,.84> which is impossible to know beforehand.

I agree your proposed syntax with outMin, outMax, inMin and inMax is better if
you're going for consistency with Photoshop/GIMP/PhotoPaint etc. I will also be
very careful saying "we don't need inMin/inMax" just because I never use it in
those programs. Personally I'd be happy with a feature which allowed me to
adjust the brightness of the darkest range and brightest range of colours
separately, by multiplying a colour expression with the darkest and brightest
pixel present in the image (as I tried to explain in my post from Saturday.)

If you add gamma to the levels expression, you can also adjust the midtones. It
will be a highlight/midtone/shadows (hms) filter, but you will have more
control with what you're doing. With hms you can easily push pixels out of
range.

Phew, hope this makes sense :)

sig.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.