I need to convert some command line imagick code into the php classes. I can't run command line scripts on our production box so I need to be able to use the classes, unfortunately there's no documentation on converting between the two.
Does anyone know how I could do this using the imagick class?
$color_mask ="convert -size $dimensions xc:#$color -fill white";
/* create the silver mask */
$silver_mask ="convert -size $dimensions xc:#e6e7e8 -fill white";
/* resize the image to the $larger_dim before cropping it to the dimensions to get that "zoomed in" effect */
$thumb = "convert images/$im -thumbnail $larger_dim^ ".
" -gravity center -extent $dimensions PNG:-";
/* screen the resized thumbnail and the color mask */
$masked = "convert $thumb $color_mask -compose Screen -gravity center -composite PNG:-";
/* multiply the masked thumb with the silver mask */
$final = "convert $masked $silver_mask -compose Multiply -gravity center -composite PNG:-";
/* Output the image*/
header("Content-Type: image/png");
passthru($final, $retval);
I'd also be happy to do the same in GD instead, I've just had issues getting the quality right in GD.
TIA