PNG transparency #4

deivian opened this Issue Jul 12, 2012 · 4 comments

3 participants


Just wondering if there is a way of resizing the PNG files without losing the transparency layer :)


I'm sure there's a way and I spent an hour or so today trying to get it working with no luck.
I'll try again later.


I spent few hours today too doing some research with no luck either. But finally I found something, a PHP object-oriented library for image manipulation called WideImage ( Maybe it can help :)


Oh wow, that looks pretty similar to what I have.
I send them an email and see if they mind if I turned their image manipulation class into a Laravel bundle :)

Thanks for the suggestion, and good find!


I think this may be of help:

// preserve transparency
if($type == "gif" or $type == "png"){
imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127));
imagealphablending($new, false);
imagesavealpha($new, true);

I'm going to come up with a mock later.

@maikeldaloo maikeldaloo closed this Dec 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment