A thumbnail has been generated for uploading images on a mobile phone. If 120120 is displayed, it will be unclear. If 360360 is generated and 80 KB is generated, is there a way to reduce the image quality without affecting the image proportion, just like uploading images on a mobile phone like ps, a thumbnail has been generated, 120
120 is not displayed clearly, and 360 is generated.360 of customers talk about K more. Is there a way to reduce the image quality without affecting the image proportion, just like ps?
Reply content:
Upload an image on your mobile phone. a thumbnail is generated, which is 120.120 is not displayed clearly, and 360 is generated.360 of customers talk about K more. Is there a way to reduce the image quality without affecting the image proportion, just like ps?
The imagepng function (resource $ image [, string $ filename [, int $ quality [, int $ filters]) is used for png files. The value of $ quality is 0-9.
Use the imagejpeg function for jpg files. The value of $ quality is 0-100.
How does PHP obtain the compression quality of images?
If you use PHP to generate a thumbnail after the client uploads the image, you can adjust the image quality, such as imagepng and imagejpeg. The third parameter is to adjust the quality, come on.
If you want to try again, you can use the browser to compress the file and upload it again.
Use the gd library to set the image quality.
You can use the image $ type method.