getImagePixelColor( $_GET[x], $_GET[y]); $q = $image->getQuantumRange(); $q = $q[quantumRangeLong]; $fuzz = (int)$_GET[fuzz]; $fuzz = ($fuzz*$q)/100; $paint_alpha = (float)$_GET[paint_alpha]; if ( $paint_alpha < 0 ) { $paint_alpha = 0; } if ( $paint_alpha > 1 ) { $paint_alpha = 1; } ## validate color ## if ( $_GET[paint_color]) { $paint_color = trim($_GET[paint_color] ); $paint_color = colors( $paint_color, "validate" ); if ( !$paint_color ) { $error = "($_GET[paint_color]) Paint color is invalid"; } } if ( $_GET[border_color]) { $border_color = trim($_GET[border_color] ); $border_color = colors( $border_color, "validate" ); if ( !$border_color ) { $error .= "
Border color is invalid"; } } if ( $error ) { $_SESSION[error] = $error; header("location:$self"); exit; } ## end validate ## ####### setopacity ####### if ( $_GET[action] == "setopacity" ) { foreach ($image as $frame) { $image->setimageopacity( $paint_alpha ); } } ##### end setopacity ##### ####### paintflood ####### if ( $_GET[action] == "paintflood" ) { foreach ($image as $frame) { $image->paintfloodfillimage( $paint_color, $fuzz, $border_color, $_GET[x], $_GET[y] ); } } ##### end paintflood ##### ##### colorfloodfill ###### if ( $_GET[action] == "colorflood" ) { foreach ($image as $frame) { $image->colorfloodfillimage( $paint_color, $fuzz, $border_color, $_GET[x], $_GET[y] ); } } ##### end colorfloodfill ###### ###### painttransparent ###### if ( $_GET[action] == "painttransparent" ) { foreach ($image as $frame) { $image->painttransparentimage( $point, $paint_alpha, $fuzz); } } ###### end painttransparent ###### ###### paintopaque ###### # xxx need to add channel if ( $_GET[action] == "paintopaque" ) { foreach ($image as $frame) { $image->paintopaqueimage( $point, $paint_color, $fuzz, $channel); } } ###### end paintopaque ###### $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 set settings $_SESSION[path] = $path; $_SESSION[paint_color] = $paint_color; $_SESSION[border_color] = $border_color; $_SESSION[fuzz] = $_GET[fuzz]; $_SESSION[paint_alpha] = $paint_alpha; header("location:display.php"); exit; } ?> <? echo "$h1: $h2"; ?>


"; echo "Your Image
"; } else { echo "
No Image
"; } ?> getImagePage(); $w = (string)$geometry[width]; $h = (string)$geometry[height]; $bytes = $image->getImagesize(); $frames = $image->getNumberImages(); $format = $image->getImageformat(); $num_colors = $image->getImageColors(); echo " "; $matte = $image->getimagemattecolor(); $color = $matte->getcolor(); $r = dechex($color[r]); $g = dechex($color[g]); $b = dechex($color[b]); # concat a zero if number is only one digit if ( strlen($r) == 1 ) { $r = "0" . $r; } if ( strlen($g) == 1 ) { $g = "0" . $g; } if ( strlen($b) == 1 ) { $b = "0" . $b; } $rgb = "$r" . "$g" . "$b"; echo ""; $border = $image->getimagebordercolor(); $color = $border->getcolor(); $r = dechex($color[r]); $g = dechex($color[g]); $b = dechex($color[b]); # concat a zero if number is only one digit if ( strlen($r) == 1 ) { $r = "0" . $r; } if ( strlen($g) == 1 ) { $g = "0" . $g; } if ( strlen($b) == 1 ) { $b = "0" . $b; } $rgb = "$r" . "$g" . "$b"; echo ""; if ( $frames > 1) { echo ""; } if ( $_GET[x] && $_GET[y] ) { $pixel = $image->getImagePixelColor($_GET[x], $_GET[y]); $color = $pixel->getcolor(); $r = dechex($color[r]); $g = dechex($color[g]); $b = dechex($color[b]); # concat a zero if number is only one digit if ( strlen($r) == 1 ) { $r = "0" . $r; } if ( strlen($g) == 1 ) { $g = "0" . $g; } if ( strlen($b) == 1 ) { $b = "0" . $b; } $rgb = "$r" . "$g" . "$b"; echo ""; } } ?>
Dimensions$w x $h
Size$bytes bytes
Number Of Colors$num_colors
Format$format
Matte Color$rgb
Border Color $rgb
Frames$frames
Color at ($_GET[x],$_GET[x])
Paint Color
Border Color
Fuzz
Alpha
Replace
Replaces all pixels the color of the point clicked with Paint Color. Optional channel
Replace Transparent
Changes any pixel that matches color with the color defined by fill with option to change its transparecy. Enter transparent as the paint color or 0 for the alpha to make the target color transparent.
Color Flood Fill
Changes the color value of any pixel that matches target and is an immediate neighbor to Paint Color until Border Color is encountered.
Alpha
The level of transparency: 1.0 is fully opaque and 0.0 is fully transparent.
Paint Flood Fill
Changes the color value of any pixel that matches the point clicked and is an immediate neighbor to Paint Color while Border Color is matched.
Set Opacity
For PNG's. Sets the image to the specified opacity level. Set Alpha. Click anywhere on image
Channel
Color channel
Fuzz
The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same.