PNG Transparency Resize with SimpleImage.php Class

Now have the transparency working for PNG but not gif. Here are the edits to the specific functions in case it will help someone else:

Save Function:

function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) {

// do this or they'll all go to jpeg

if( $image_type == IMAGETYPE_JPEG ) {
} elseif( $image_type == IMAGETYPE_GIF ) {
} elseif( $image_type == IMAGETYPE_PNG ) {
// need this for transparent png to work
imagealphablending($this->image, false);
if( $permissions != null) {

Reference Link : Stackoverlfow


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s