[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Brightness/Contrast Code



Hi Werner,

> While trying to "reverse engineer" the brightness/contrast code used in
> many programs, this is what I have come up with and it resembles to 99%
> the Photoshop "brightness/contrast" :
>
> ...
>
> Maybe we could create a new "FAQ" where we try to reverse engineer known
> functions used in various painting programs (PS, PSP, PhotoPaint, etc...).

Great idea, Werner. Here's my contribution. It's the FiFo code for 
"Median Cut" effect known from PSP and Photoshop. Programming 
it in FF isn't possible.


!{fonlysel=1}

put(r,0);
put(src(x+1,y,0),1);
put(src(x+1,y+1,0),2);
put(src(x,y+1,0),3);
put(src(x-1,y,0),4);
put(src(x-1,y-1,0),5);
put(src(x,y-1,0),6);
put(src(x+1,y-1,0),7);
put(src(x-1,y+1,0),8);
sort(0,8);
R=get(4);


put(g,0);
put(src(x+1,y,1),1);
put(src(x+1,y+1,1),2);
put(src(x,y+1,1),3);
put(src(x-1,y,1),4);
put(src(x-1,y-1,1),5);
put(src(x,y-1,1),6);
put(src(x+1,y-1,1),7);
put(src(x-1,y+1,1),8);
sort(0,8);
G=get(4);

put(r,0);
put(src(x+1,y,2),1);
put(src(x+1,y+1,2),2);
put(src(x,y+1,2),3);
put(src(x-1,y,2),4);
put(src(x-1,y-1,2),5);
put(src(x,y-1,2),6);
put(src(x+1,y-1,2),7);
put(src(x-1,y+1,2),8);
sort(0,8);
B=get(4);


 
> See also the FFPG with the codes for the apply modes (multiply,
> difference, etc...)

I have this stuff as Transition Factory code, as FF can't combine two 
source images. Actually I translated your pseudo code from the 
FFPG :-). Do you want to include it in the FFPG, Werner?

Greetings,
Harry


PlugIn Com HQ - 
Plugins, Effects and Tools for Image and Video Editing
http://pico.i-us.com/