error_reporting(0); include("functions.php"); $h1 = "DJ Mike's Image Maker 2"; $h2 = "Gamma"; ##### Start gamma if ( $_GET[gamma] ) { $gamma = trim( $_GET[gamma] ); ##### Validate degrees if ( preg_match( "#[^0-9\-\.]#", "$gamma", $x) ) { $_SESSION[error] = "Enter numbers only"; header("location:$self"); } ############# $image = new Imagick($_SESSION[path]); foreach ($image as $frame) { $frame->gammaImage($gamma, $channel ); } $format = strtolower( $image->getimageformat() ); $path = "temp/$ID.$_SESSION[views].$format"; $frames = $image->getNumberImages(); if ( $frames > 1) { $image->writeImages("$path", TRUE); } else { $image->writeImage("$path"); } # save settings $_SESSION[path] = $path; $_SESSION[gamma] = $gamma; header("Location: display.php"); exit; } ######### end gamma include("top.php"); ?>
Gamma-corrects an image. The same image viewed on different devices will have perceptual differences in the way the image's intensities are represented on the screen. Specify individual gamma levels for the red, green, and blue channels, or adjust all three with the gamma parameter. Values typically range from 0.8 to 2.3.
include("footer.php"); ?>