Resize, crop and then mask
Posted: 2012-06-11T01:28:54-07:00
Hi.
I have some images that I would like to risize to shortest side, then cop the logest side and then put a mask to it.
I have this code:
// resize
$cmd = "convert $image -resize 212x250^ -gravity center -extent 212x250 $new_name";
exec("$cmd");
//mask
$cmd = "composite $new_name $overlay $mask $new_name";
exec("$cmd");
I use PHP.
The first part does resize and crop, but as soon as I add the mask part, it crops the imge to 212x212 pixels.
My mask-image is 212x250 pixels.
Is there another way to do this, maybe in one line of code?
I have some images that I would like to risize to shortest side, then cop the logest side and then put a mask to it.
I have this code:
// resize
$cmd = "convert $image -resize 212x250^ -gravity center -extent 212x250 $new_name";
exec("$cmd");
//mask
$cmd = "composite $new_name $overlay $mask $new_name";
exec("$cmd");
I use PHP.
The first part does resize and crop, but as soon as I add the mask part, it crops the imge to 212x212 pixels.
My mask-image is 212x250 pixels.
Is there another way to do this, maybe in one line of code?