image
image copied to clipboard
Encoding from existing JPG to JPG significantly increases file size
I've just noticed that using the encode method increases the file size significantly if you try to encode a JPG to JPG.
Example:
$image = $this->image->make($originalJpgImage);
$imageJpgEncoded = (string)$image->encode('jpg',100);
Results with GD:
- Original: 42 KB
- Encoded: 112 KB
Results with Imagick:
- Original: 42 KB
- Encoded: 61 KB
Setting the quality 80 gets me decently close to the original file size, but I fail to understand what is causing such an increase. Could someone elaborate on why this is happening? And is this normal behavior?