generate functionThu, 15 Dec 2022

get png by path, convert to jpg, compress 100 and replace file with jpg extension

<?php $path = ""; $img = new Imagick($path); $img->setImageFormat("jpg"); $img->setImageCompression(Imagick::COMPRESSION_JPEG); $img->setImageCompressionQuality(100); $img->stripImage(); $img->writeImage(""); $img->clear(); $img->destroy(); ?>

Want to kickstart your project?Use the new AI Studio to create your code