Created
November 17, 2010 03:42
-
-
Save drewlesueur/702946 to your computer and use it in GitHub Desktop.
Simple image manipulation functions for php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function resize_image($image, $w, $h) { | |
$ret = imagecreatetruecolor($w, $h); | |
imagealphablending( $ret, false ); | |
imagesavealpha( $ret, true ); | |
imagecopyresampled($ret, $image, 0, 0, 0, 0, $w, $h, imagesx($image), imagesy($image)); | |
//imageantialias($ret,true); | |
return $ret; | |
} | |
public static function overlay_image($image, $overlay, $x, $y) { | |
imagealphablending($image, true); | |
imagealphablending($overlay, true); | |
imagecopy($image, $overlay, $x, $y, 0, 0, imagesx($overlay), imagesy($overlay)); | |
//return $image; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment