I am using Imagick in PHP to create an image with the property "chroma subsampling" to 4:2:2 (2x1,1x1,1x1)
I use this code:
$image = new Imagick('test.jpg');
$factors = array("2,1,1");
$image->setSamplingFactors($factors);
$image->writeImage('test2.jpg');
$image->destroy();
but the result is:
jpeg:sampling-factor: 2x2,1x1,1x1
To see the image's properties; I use:
$image = new Imagick(test2.jpg');
$identify = $image->identifyImage(TRUE);
$data = $identify['rawOutput'];
I want to set:
jpeg:sampling-factor: 2x1,1x1,1x1
Thanks in advance for your help and time
I found one solution using shell_exec,
I hope to find the right solution using only imagick methods.