Intervention / image

PHP Image Processing
https://image.intervention.io
MIT License
13.84k stars 1.5k forks source link

Image size increases if the uploaded image is compressed image #1288

Closed ASAMNYA closed 7 months ago

ASAMNYA commented 7 months ago

I have noticed when a compressed image is uploaded and if the image quality save is set to 100 then uploaded image size increases significantly.

$thumbnailImage->save($originalPath . $uploadFileName, 100);

Original Compressed Image Size 100 KB

After uploading to server via Intervention Package 704 KB

Environment

olivervogel commented 7 months ago

The previous compression and optimization is discarded during the decoding and encoding process. This is normal behavior.

The deciding factor is the quality parameter, which in your example is 100, resulting in a very large file size. You can reduce the file size by lowering the value of the parameter. The additional compression optimization must then be done again.