Auto Correct Brightness

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
kevin7654
Forum Newbie
Posts: 19
Joined: Sat Feb 18, 2006 2:38 pm

Auto Correct Brightness

Post by kevin7654 »

Does anyone know of any scripts that apply an auto correct feature that corrects the brightness, contrast, etc? I'm thinking of something that is common in most of the consumer level photo organization tools such as google's picasso or photoshop album.

Thanks,
Kevin
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

You could iterate over the pixels in the image and add a fixed value to the red, green, and blue values, then set the new value in the image to change the brightness
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Correctly increasing the brightness of an image actually gives slightly different leveling to the green than the blue or red colors due to how sensitive our eyes are to the green spectrum.

If building such a thing myself I would likely implement some sort of scaling function to expand out the histogram.
kevin7654
Forum Newbie
Posts: 19
Joined: Sat Feb 18, 2006 2:38 pm

Post by kevin7654 »

thanks for the responses. So I take it there is no sort of script that is available to do this function?
Post Reply