PHP image disposal

Source: Internet
Author: User
PHP processes images. how can I set the size of uploaded images to less than KB? Can I only change the image size? In fact, what is the relationship between the Pixel, size, and definition of the image? yes. The size will be affected ., Control the compression ratio because some images are processed in PHP.

You can upload images.
How can I keep the size of the uploaded image below KB each time?
Can I only change the image size?
In fact, what is the relationship between the Pixel, size, and definition of the image ..
------ Solution --------------------
Yes. The size will be affected.
------ Solution --------------------
Control the compression ratio. if some images have too many pixels, scale down to a specified ratio may not be less than 200 KB, so you need to control the optimal proportion of the maximum size of the uploaded image to k...
------ Solution --------------------
From the popular image collection devices, 200 K is just a normal stamp.
Definition refers to the pixel Prime used to indicate a target of a known size. of course, the more clear the target

For example, the hair diameter is about 70 ~ Between 100 μm
You use a pixel representation, so it's just a thin line
If you use 100 pixels, you will be able to see the scales on the hair.
------ Solution --------------------
The relationship between pixels and image size is the relationship between units and population.
The relationship between pixel and image file size (in bytes) is described in #2.
A 1/6x250 pixel lossless full color (24bit) image is k plus the file header. jpg (non-jpg2000) is about k lossless.
The reason is that jpg has a multi-level compression rate and the color value of each pixel is also affected. Therefore, the number of bytes is not fixed.
24-bit sampling is used for the same pixel "Kaleidoscope" and pure color images. The two are lossless images with the same number of bytes, but the latter in jpg format is much smaller.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.