u214 Posted May 1, 2011 Share Posted May 1, 2011 So. I'm using this code right here: <?php $imagepath = "css/images/statspage.jpg"; $image = imagecreatefromjpeg($imagepath); $imgheight = imagesy($image); $color = imagecolorallocate($image, 255, 255, 255); imagestring($image, 5, 70, $imgheight-50, "This is a test", $color); header('Content-Type: image/jpeg'); imagejpeg($image); ?> It works like it should. Now my problem is, is that the image is being displayed at a very low quality! Here's the original image: Here's the image with the code above: RIGHT away you can tell the HUGE difference. I'm not sure what I'm doing wrong. Maybe i need a higher res image? If y'all guys know a different method THAT also achieves the same thing I'm trying to do. Please let me know ASAP! Link to comment https://forums.phpfreaks.com/topic/235245-images-are-shown-with-very-low-quality/ Share on other sites More sharing options...
PaulRyan Posted May 1, 2011 Share Posted May 1, 2011 Try using this... <?php $imagepath = "css/images/statspage.jpg"; $image = imagecreatefromjpeg($imagepath); $imgheight = imagesy($image); $color = imagecolorallocate($image, 255, 255, 255); imagestring($image, 5, 70, $imgheight-50, "This is a test", $color); header('Content-Type: image/jpeg'); imagejpeg($image, NULL, 100); ?> Tell me how it goes. Regards, PaulRyan. Link to comment https://forums.phpfreaks.com/topic/235245-images-are-shown-with-very-low-quality/#findComment-1208927 Share on other sites More sharing options...
u214 Posted May 1, 2011 Author Share Posted May 1, 2011 . Very nice. Thank you sooo much man. Works perfectly. I guess I should get into reading more about the PHP function parameters. imagejpeg - Parameters: Image, Filename, QUALITY Thank you so much once again! Link to comment https://forums.phpfreaks.com/topic/235245-images-are-shown-with-very-low-quality/#findComment-1208934 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.