Friday, 3 May 2019

Resize large image .tiff format to specific file size using ImageMagick and PHP

I need resize an uploaded image in TIFF format to specific file size less than 95 kB using imagick and php. Can someone tell me best way to get size below of 95kb?
I am using below code but using this code sometimes i got image size greater than 95kb?

$filename = "test.jpg";
$image = new Imagick($filename);
$image->setImageCompressionQuality(int(40));
$img =  preg_replace('/\\.[^.\\s]{3,4}$/', '', $filename).".tiff";
$image->writeImage($img);



from Resize large image .tiff format to specific file size using ImageMagick and PHP

1 comment:

  1. https://www.wizweb.in

    Wizweb Technology is a leading software development company custom website design, software development, SMS Provider, Bulk sms, transactional sms, promotional sms, mobile app development, Hosting Solution, seo(search engine optimization) and Digital marketing etc.

    ReplyDelete