php - Cropping an image using Jcrop and Imagemagick -
i'm confused on how -crop function works in imagemagick.
i have following values jcrop.
(x1,y1), (x2,y2), width , height. and following command:
exec("convert $target_path -crop ".$w."x".$h."+$x+$y +repage $target_path"); original image:

result after crop:

my question is, how used coordinates , dimensions jcrop, , use them imagemagick?
i have no idea values passing convert, command needs extract light region -if aim:
convert x.png -crop 240x240+120+100 out.png 
the first 240 width of cropped area, , second 240 height. 120 x-offset across top-left corner , +100 y-offset down top.
or, in general terms, specify crop this
convert input.png -crop ${x}x${y}+${a}+${b} output.png 
Comments
Post a Comment