I have a javascript canvas that I convert to blob using image/webp and a quality of 0.25.
This canvas blob is then posted to my php which loads the image into Imagick and does virtually nothing (so far), but the image goes from 269Kb to 357Kb in size – what is happening here and how can I prevent this?
js
mycanvas.convertToBlob({type: 'image/webp', quality: 0.25}).then(resultBlob => {
sendImage(resultBlob, file.name);
resolve();
}).catch(error => {
reject(error);
});
php
$imagick = new Imagick();
$imagick->setResourceLimit(Imagick::RESOURCETYPE_AREA, 90000000);
$imagick->readImageBlob($blob);
if ( $imagick->getImageFormat()!='web' ) $imagick->setImageFormat('webp');
$tblob = $imagick->getImageBlob();
$size = strlen($tblob);
1