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? Link to comment https://forums.phpfreaks.com/topic/31102-change-quality-of-image/ 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? Link to comment https://forums.phpfreaks.com/topic/31102-change-quality-of-image/#findComment-143679 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 Link to comment https://forums.phpfreaks.com/topic/31102-change-quality-of-image/#findComment-143683 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.