imgix APIsRendering APIObject Removal

Object Removal

object-removal-rect

Premium Feature

Object Removal is currently available for imgix customers on our Premium plans. If you’re interested in this feature, please contact our sales team for more information.

The object removal parameter allows you to select and remove parts of an image using AI.

Original image
sandbox-demo
object-removal-rect=245,1779,1225,608
sandbox-demo

Usage

object-removal-rect accepts four integers represented in this order: x,y,w,h. These values represent the coordinates of a rectangle which is used to select objects in an image.

Those values represent the following:

  • x: The longitude coordinate relative to the original image’s width
  • y: The latitude coordinate relative to the original image’s height
  • w: The pixel width of the rectangle relative to the original image’s width
  • h: The pixel height of the rectangle relative to the original image’s height

By specifying the x, y, width, and height, you can define a rectangle coordinate to process object removal over an image.

Note that these coordinates are relative to the original image’s dimensions. Resizing an image will not change the rectangle’s x,y,w,h position, even if you change the image’s aspect ratio or size using the size parameters. This means you can remove any object based on the original image’s dimensions, and no matter how you crop or scale the image, the same objects will be removed.

You can define multiple rectangle coordinates over an image by separating them with a semicolon (;).

object-removal-rect=850,150,1398,1217
sandbox-demo
object-removal-rect=850,150,1398,1217;920,2452,1280,1252
sandbox-demo

See our Image Editor documentation to remove objects using a point-and-click user interface in the Asset Manager.

Chaining AI transformations

The Rendering API processes multiple AI transformations asynchronously and requires a few seconds to complete. When present, multiple AI transformations get rendered in this order:

Read this tutorial to learn more about chaining AI transformations.

Chaining AI transformations

Please get in touch with your Account Manager or Support with any questions or feedback.