tylla

tylla

Joined
Jul 05, 2006

Activity Stream

tylla commented on a Page, Image Thumbnails  -  Jul 05, 2006

Some hint if you want to use this code for true-color alpha channel transparent images (actually tried it on png-s).
After the

$new_img = imagecreatetruecolor($neww,$newh);

line I added these:

imagealphablending( $new_img, false );
$col = imagecolorallocatealpha( $new_img, 0, 0, 0, 127 );
imagefilledrectangle( $new_img, 0, 0, $neww, $newh, $col );
imagealphablending( $new_img, true );
imageSaveAlpha($new_img, true);

This fills the new image with fully transparent pixels.
The most painful was the last function call, because it took some half an hour to discover that without it the alpha channel isn\'t saved with the image.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.