error_reporting(0); include("functions.php"); $h1 = "DJ Mike's Image Maker 2"; $h2 = "Cyclecolormap"; ##### Start cyclecolormap if ( $_GET[cyclecolormap] ) { $cyclecolormap = trim($_GET[cyclecolormap]); ##### Validate degrees if ( preg_match( "#[^0-9\-\.]#", "$cyclecolormap", $x) ) { $_SESSION[error] = "Enter numbers only"; header("location:$self"); } ############# $image = new Imagick($_SESSION[path]); $cyclecolormap = (double)$cyclecolormap; foreach ($image as $frame) { $frame->cyclecolormapImage($cyclecolormap); } $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[cyclecolormap] = $cyclecolormap; header("Location: display.php"); exit; } ######### end cyclecolormap include("top.php"); ?>
Displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychedelic effect.
include("footer.php"); ?>