brightness & contrast
David Tremmel
david.tremmel at duke.edu
Mon Jul 29 14:23:00 EDT 2002
I played around with this a bit (before Ken came out with his excellent
tutorial), but never looked for formal algorithms because I found that
manipulations took so long for my 640 x 480 images (at least on my old G4
400 Mac running OS X).
However, I did come up with a way to mimic brightness adjustment using the
blendLevel command. I set up a horizontal scrollbar to control the
brightness level; in this case the start and end points are 0 and 200. I
also placed a graphic (BackRect in the example) the same size and location
as the image in a layer behind the image. Using 100 (the midpoint of the
scroll) as the breakpoint between lightening and darkening, I used the
following script in the scrollbar:
on scrollbardrag
get round(the thumbPosition of me,0)
if it < 100 then
set the backColor of graphic "BackRect" to black
# This sets the background black for darkening
get 100 - it
else
set the backColor of graphic "BackRect" to white
# This sets the background white for lightening
get it - 100
end if
set the blendLevel of image "TestImage" to it
end scrollbardrag
This works pretty well, and the results are seen in real time.
Regards,
Dave Tremmel
> With ColorIt on the Mac I can adjust Brightness & Contrast of images.
>
> Is there any way I can do either or both of these with Rev?
>
>
> atb
>
> sims
>
> --__--__--
More information about the use-livecode
mailing list