I am trying to compress the quality of an image using ImageMagick. I mean that I have an image which dimension is 1600X800 and size is 4MB. Now I am trying to compress the quality of this image into 2MB without resizing its dimensions, means the newly generated image also have the same dimension as actual image (i.e. 1600X800) but the quality of this image should be compress into 2MB (half of the actual image). For this, now I am using the below code, but this is not compress the size of the newly created image:
$src_img = "src.png";
$dest_img = "dest.png";
exec("convert $src_img -quality 90 $dest_img");
So can anyone please tell me what can I do to compress the size of the image without losing its actual dimension using ImageMagick?