I want to resize 2 types of images (png, gif) with transparent background...
-
But in png it works well in big size of the original image. eg. Original file dimension is 150x150
change into 200x200 or exceeding the original size it works well. but in 100x100 it displays
-
Then the last GIF it doesn't work.
Here my code for png
$new_img = imagecreatetruecolor($max_w, $max_h); imagealphablending($new_img, false); imagesavealpha($new_img, true); $transparentindex = imagecolorallocatealpha($new_img, 255, 255, 255, 127); imagefill($new_img, 0, 0, $transparentindex); imagepng($new_img, $dir); Here my code for gif imagegif($new_img, $dir);