Source Rectangle Region
rect
By default, the entire image is used as the area for processing. The rect
parameter selects a sub-region of the source image for processing before applying other resize operations.
The value for rect
is four integers or relative values representing the starting coordinates (x
and y
) and the size (width
and height
), all separated by commas. This is represented as rect=x,y,w,h
.
x
: Accepts either an integer, float, orleft
,center
, andright
options.left
is equivalent to0
,center
is equivalent to half of the difference of the image width minus therect
width, andright
is the difference between the image width minus therect
width.0.5
positions the left edge of the rectangle at the center of the image.y
: Accepts either an integer, float, ortop
,middle
, andbottom
options.top
is equivalent to0
,middle
is equivalent to the half the difference of the image height minus therect
height, andbottom
is equivalent to the difference of the image height minus therect
height.0.5
positions the top edge of the rectangle at the center of the image.w
: can take either an integer (ex: 500) representing the pixel width, a float (ex:0.5
) representing the scalar width, orfull
, which is equivalent to the full width of the image.h
: can take either an integer (ex: 500) representing the pixel height, a float (ex:0.5
) representing the scalar height, orfull
, which is equivalent to the full height of the image.