readImageBlob("$blob"); $width2 = $image_2->getimagewidth(); $height2 = $image_2->getimageheight(); } catch ( exception $e ) { $error = "ERROR: Could not read $url"; } if ( $error ) { $_SESSION[error] = "ERROR: Could not read $url"; header("location;$self"); exit; } $image_2->coalesceImages(); try { switch ( $_GET[composite] ) { case "ADD" : $composite = imagick::COMPOSITE_ADD; break; case "ATOP" : $composite = imagick::COMPOSITE_ATOP; break; case "BLEND" : $composite = imagick::COMPOSITE_BLEND; break; case "BUMPMAP" : $composite = imagick::COMPOSITE_BUMPMAP; break; case "CHANGEMASK" : $composite = imagick::COMPOSITE_CHANGEMASK; break; case "CLEAR" : $composite = imagick::COMPOSITE_CLEAR; break; case "COLORBURN" : $composite = imagick::COMPOSITE_COLORBURN; break; case "COLORDODGE" : $composite = imagick::COMPOSITE_COLORDODGE; break; case "COLORIZE" : $composite = imagick::COMPOSITE_COLORIZE; break; case "imagick::COMPOSITE_COPY" : $composite = imagick::COMPOSITE_COPY; break; case "COPYBLACK" : $composite = imagick::COMPOSITE_COPYBLACK; break; case "COPYBLUE" : $composite = imagick::COMPOSITE_COPYBLUE; break; case "COPYCYAN" : $composite = imagick::COMPOSITE_COPYCYAN; break; case "COPYGREEN" : $composite = imagick::COMPOSITE_COPYGREEN; break; case "COPYMAGENTA" : $composite = imagick::COMPOSITE_COPYMAGENTA; break; case "COPYOPACITY" : $composite = imagick::COMPOSITE_COPYOPACITY; break; case "COPYRED" : $composite = imagick::COMPOSITE_COPYRED; break; case "COPYYELLOW" : $composite = imagick::COMPOSITE_COPYYELLOW; break; case "DARKEN" : $composite = imagick::COMPOSITE_DARKEN; break; case "DIFFERENCE" : $composite = imagick::COMPOSITE_DIFFERENCE; break; case "DISPLACE" : $composite = imagick::COMPOSITE_DISPLACE; break; case "DISSOLVE" : $composite = imagick::COMPOSITE_DISSOLVE; break; case "DST" : $composite = imagick::COMPOSITE_DST; break; case "DSTATOP" : $composite = imagick::COMPOSITE_DSTATOP; break; case "DSTIN" : $composite = imagick::COMPOSITE_DSTIN; break; case "DSTOUT" : $composite = imagick::COMPOSITE_DSTOUT; break; case "DSTOVER" : $composite = imagick::COMPOSITE_DSTOVER; break; case "DIVIDE" : $composite = imagick::COMPOSITE_DIVIDE; break; case "EXCLUSION" : $composite = imagick::COMPOSITE_EXCLUSION; break; case "IN": $composite = imagick::COMPOSITE_IN; break; case "MINUS" : $composite = imagick::COMPOSITE_MINUS; break; case "MODULATE" : $composite = imagick::COMPOSITE_MODULATE; break; case "MULTIPLY" : $composite = imagick::COMPOSITE_MULTIPLY; break; case "NONE" : $composite = imagick::COMPOSITE_NONE; break; case "OUT" : $composite = imagick::COMPOSITE_OUT; break; case "OVER" : $composite = imagick::COMPOSITE_OVER; break; case "OVERLAY" : $composite = imagick::COMPOSITE_OVERLAY; break; case "PLUS" : $composite = imagick::COMPOSITE_PLUS; break; case "HARDLIGHT" : $composite = imagick::COMPOSITE_HARDLIGHT; break; case "HUE" : $composite = imagick::COMPOSITE_HUE; break; case "LIGHTEN" : $composite = imagick::COMPOSITE_LIGHTEN; break; case "SATURATE" : $composite = imagick::COMPOSITE_SATURATE; break; case "SCREEN" : $composite = imagick::COMPOSITE_SCREEN; break; case "SOFTLIGHT" : $composite = imagick::COMPOSITE_SOFTLIGHT; break; case "SRC" : $composite = imagick::COMPOSITE_SRC; break; case "SRCATOP" : $composite = imagick::COMPOSITE_SRCATOP; break; case "SRCIN" : $composite = imagick::COMPOSITE_SRCIN; break; case "SRCOUT" : $composite = imagick::COMPOSITE_SRCOUT; break; case "SRCOVER" : $composite = imagick::COMPOSITE_SRCOVER; break; case "LINEARLIGHT" : $composite = imagick::COMPOSITE_LINEARLIGHT; break; case "LUMINIZE" : $composite = imagick::COMPOSITE_LUMINIZE; break; case "REPLACE" : $composite = imagick::COMPOSITE_REPLACE; break; case "SUBTRACT" : $composite = imagick::COMPOSITE_SUBTRACT; break; case "THRESHOLD" : $composite = imagick::COMPOSITE_THRESHOLD; break; case "XOR" : $composite = imagick::COMPOSITE_XOR; break; default : $composite = imagick::COMPOSITE_DEFAULT; break; } } # end try catch ( exception $e ) { $_SESSION[error] = $e->getmessage(); header("location:$self"); exit; } switch ( $_GET[gravity] ) { case "NORTHWEST" : $gravity = imagick::GRAVITY_NORTHWEST; break; case "NORTH" : $gravity = imagick::GRAVITY_NORTH; break; case "NORTHEAST" : $gravity = imagick::GRAVITY_NORTHEAST; break; case "WEST" : $gravity = imagick::GRAVITY_WEST; break; case "EAST" : $gravity = imagick::GRAVITY_EAST; break; case "SOUTHWEST" : $gravity = imagick::GRAVITY_SOUTHWEST; break; case "SOUTH" : $gravity = imagick::GRAVITY_SOUTH; break; case "SOUTHEAST" : $gravity = imagick::GRAVITY_SOUTHEAST; break; default : $gravity = imagick::GRAVITY_CENTER; } $off_x = (int)$_GET[off_x]; $off_y = (int)$_GET[off_y]; $deg = (float)$_GET[deg]; $skew_x = (float)$_GET[skew_x]; $skew_y = (float)$_GET[skew_y]; # make a draw object for settings $draw = new imagickdraw(); # set gravity $draw->setgravity($gravity); $draw->rotate($deg); $draw->skewx($skew_x); $draw->skewy($skew_y); if ( $_GET[autoscale] == "on" ) { $width1 = $image->getimagewidth(); $height1 = $image->getimageheight(); $scaleX = $width1/$width2; $scaleY = $height1/$height2; $width2 = $width2*$scaleX; $height2 = $height2*$scaleY; } $draw->composite( $composite, $off_x, $off_y, $width2, $height2, $image_2); # apply draw to top image $image_2->drawimage($draw); # Composite foreach ($image as $frame) { $image->drawimage($draw); } $format = strtolower( $image->getimageformat() ); $path = "temp/$ID.$_SESSION[views].$format"; $path = "temp/$ID.$_SESSION[views].$format"; $frames = $image->getNumberImages(); if ( $frames > 1) { $image->writeImages("$path", TRUE); } else { $image->writeImage("$path"); } # save $_SESSION[path] = $path; $_SESSION[composite_url] = $url; $_SESSION[off_x] = $off_x; $_SESSION[off_y] = $off_y; $_SESSION[composite_deg] = (float)$_GET[deg]; $_SESSION[composite_skew_x] = (float)$_GET[skew_x]; $_SESSION[composite_skew_y] = (float)$_GET[skew_y]; header("location:display.php"); exit; } ################### include("top.php"); ?>

URL:
Offset:  X Y
Skew:  X Y
Rotate: Auto scale
Description
Combines pixels from a different image with your target image. You can control composition by choosing which image to combine, where the combining occurs (the offset from the target image), and how the pixels are combined (composite operation).
URL
URL of second image
Offset
Offset from origin in pixels.
Gravity
Origin of offset. N = center top, E = middle right etc. Defaults to center.
Skew
Optional. Skew second image before compositing it. Enter skew angles in degrees.
Composite Operator
How the pixels are combined.
Atop
The part of the source lying inside of the destination is composited onto the destination.
Bumpmap
The same as Multiply, except the source is converted to greyscale first.
Clear
Both the color and the alpha of the destination are cleared. Neither the source nor the destination are used as input.
ColorBurn
Darkens the destination color to reflect the source color. Painting with white produces no change.
ColorDodge
Brightens the destination color to reflect the source color. Painting with black produces no change.
Copy
Simply place the source on top of the destination.
Darken
Selects the darker of the destination and source colors. The destination is replaced with the source when the source is darker, otherwise it is left unchanged.
Difference
Subtracts the darker of the two constituent colors from the lighter. Painting with white inverts the destination color. Painting with black produces no change.
Displace
Dst
The destination is left untouched.
DstAtop
The part of the destination lying inside of the source is composited over the source and replaces the destination.
DstIn
The part of the destination lying inside of the source replaces the destination.
DstOut
The part of the destination lying outside of the source replaces the destination.
DstOver
The destination is composited over the source and the result replaces the destination.
Exclusion
Produces an effect similar to that of 'difference', but appears as lower contrast. Painting with white inverts the destination color. Painting with black produces no change.
HardLight
Multiplies or screens the colors, dependent on the source color value. If the source color is lighter than 0.5, the destination is lightened as if it were screened. If the source color is darker than 0.5, the destination is darkened, as if it were multiplied. The degree of lightening or darkening is proportional to the difference between the source color and 0.5. If it is equal to 0.5 the destination is unchanged. Painting with pure black or white produces black or white.
In
The part of the source lying inside of the destination replaces the destination.
Lighten
Selects the lighter of the destination and source colors. The destination is replaced with the source when the source is lighter, otherwise it is left unchanged.
Minus
The source is subtracted to the destination and replaces the destination.
Multiply
The source is multiplied by the destination and replaces the destination. The resultant color is always at least as dark as either of the two constituent colors. Multiplying any color with black produces black. Multiplying any color with white leaves the original color unchanged.
Out
The part of the source lying outside of the destination replaces the destination.
Over
Overlay second image over the first
Overlay
Multiplies or screens the colors, dependent on the destination color. Source colors overlay the destination whilst preserving its highlights and shadows. The destination color is not replaced, but is mixed with the source color to reflect the lightness or darkness of the destination.
Plus
The source is added to the destination and replaces the destination. This operator is useful for animating a dissolve between two images.
Screen
The source and destination are complemented and then multiplied and then replace the destination. The resultant color is always at least as light as either of the two constituent colors. Screening any color with white produces white. Screening any color with black leaves the original color unchanged.
Src
The source is copied to the destination. The destination is not used as input.
SoftLight
Darkens or lightens the colors, dependent on the source color value. If the source color is lighter than 0.5, the destination is lightened. If the source color is darker than 0.5, the destination is darkened, as if it were burned in. The degree of darkening or lightening is proportional to the difference between the source color and 0.5. If it is equal to 0.5, the destination is unchanged. Painting with pure black or white produces a distinctly darker or lighter area, but does not result in pure black or white.
XOR
The part of the source that lies outside of the destination is combined with the part of the destination that lies outside of the source.
Rotate
Optional. Rotate second image before compositing it. Enter rotatation angle in degrees
Auto Scale
Scale the second image to the same size as the first before composting