Hamlets666 Posted December 18, 2006 Share Posted December 18, 2006 [code]$neww=40;$newh=40;list(, , $type,)=@getimagesize($file);if ($type==1) {$funci="imagecreatefromgif";} //$funco="imagegif";}if ($type==2) {$funci="imagecreatefromjpeg";} //$funco="imagejpeg";}$im1 = @$funci($file);$im2=@ImageCreate($neww,$newh);@imagecopyresized($im2, $im1, 0,0,0,0,$neww,$newh, @imagesx($im1), @imagesy($im1));@header("Content-type: image/png");@imagepng($im2);[/code]It`s code which changes image size(pixels), but after this image size(kb) is still too big for me, so are there any ideas, how could I change quality of image? Quote Link to comment Share on other sites More sharing options...
zq29 Posted December 18, 2006 Share Posted December 18, 2006 You could save the image as a jpeg and use the third parameter of the imagejpeg function to control the compression. Or do you specifically require your images to be png? Quote Link to comment Share on other sites More sharing options...
Hamlets666 Posted December 18, 2006 Author Share Posted December 18, 2006 They can be gif, only if it will make them smaller :) Quality can be very bad it would be o.k ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.