rabikhadka Posted February 17, 2007 Share Posted February 17, 2007 can any one suggest me how to increase image size without effecting the quality of the image. it should be at the runtime using gd library Link to comment https://forums.phpfreaks.com/topic/38942-increasing-image-size-without-effecting-much-of-quality-using-gd-library/ Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 use math formulas like <img src=\"width\"= $currentWidthofImage * 2 \"height\"=$currentHeightofImage * 2> would double the image it self without you guessing the height or width Link to comment https://forums.phpfreaks.com/topic/38942-increasing-image-size-without-effecting-much-of-quality-using-gd-library/#findComment-187327 Share on other sites More sharing options...
rabikhadka Posted February 17, 2007 Author Share Posted February 17, 2007 thank you, but i want to use GD library for on the fly image resize Link to comment https://forums.phpfreaks.com/topic/38942-increasing-image-size-without-effecting-much-of-quality-using-gd-library/#findComment-187336 Share on other sites More sharing options...
fert Posted February 17, 2007 Share Posted February 17, 2007 http://us3.php.net/manual/en/function.imagecopyresampled.php Link to comment https://forums.phpfreaks.com/topic/38942-increasing-image-size-without-effecting-much-of-quality-using-gd-library/#findComment-187337 Share on other sites More sharing options...
rabikhadka Posted February 17, 2007 Author Share Posted February 17, 2007 thank you, but the image quality gets worst when increase the site. i used this code <?php // The file $filename = '24.jpg'; $percent = 3; // Content type header('Content-type: image/jpeg'); // Get new dimensions list($width, $height) = getimagesize($filename); $new_width = $width * $percent; $new_height = $height * $percent; // Resample $image_p = imagecreatetruecolor($new_width, $new_height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); // Output imagejpeg($image_p, null, 100); ?> Link to comment https://forums.phpfreaks.com/topic/38942-increasing-image-size-without-effecting-much-of-quality-using-gd-library/#findComment-187353 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.