imgix APIsRendering APISizeSource Rectangle Region

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 to use for processing before applying other resize operations.

The value for rect is four integers or relative values representing the starting coordinates of x and y and the width and height, all separated by commas.

x can take either an integer, float, or left, center, and right options. left is equivalent to 0, center is equivalent to half of the difference of the image width minus the rect width, and right is the difference between the image width minus the rect width.

Similarly, y can take either an integer, float, or top, middle, and bottom options. top is equivalent to 0, middle is equivalent to the half the difference of the image height minus the rect height, and bottom is equivalent to the difference of the image height minus the rect height.