error_reporting(0); include("functions.php"); $h1 = "DJ Mike's Image Maker 2"; $h2 = "Tint"; ##### Start tint if ( $_GET[tint_color] && $_GET[tint_opacity ]) { $tint_color = trim( $_GET[tint_color] ); $tint_color = colors( $tint_color, "validate" ); #echo "tint_color = $tint_color"; #exit; $tint_opacity = trim( $_GET[tint_opacity] ); $tint_opacity = (float)$tint_opacity; if ( !$tint_color ) { $_SESSION[error] = "Invalid Color"; header("location:$self"); exit; } ############# $image = new Imagick($_SESSION[path]); foreach ($image as $frame) { $frame->tintImage($tint_color, $tint_opacity); } # make new path $format = strtolower( $image->getimageformat() ); $path = "temp/$ID.$_SESSION[views].$format"; # write image $frames = $image->getNumberImages(); if ( $frames > 1) { $image->writeImages("$path", TRUE); } else { $image->writeImage("$path"); } # save settings $_SESSION[path] = $path; $_SESSION[tint_color] = $tint; $_SESSION[tint_opacity] = $tint; header("location:display.php"); exit; } ######### end tint include("top.php"); ?> include("click.php"); ?>
Tint Color can be a named color or hex. Opacity is a number.
include("footer.php"); ?>