getAutoCropRect

Returns a cropped region for an image based on its background color or transparency.

Syntax

Authorized User Types

  • IpsAdmin
  • IpsCompanyAdmin
  • IpsUser
  • ImagePortalAdmin
  • ImagePortalUser
  • ImagePortalContrib
  • ImagePortalContribUser

Parameters

Input (getAutoCropRectParam)

NOTE
Specify either autoColorCropOptions or autoTransparentCropOptions when calling this method.
Name
Type
Required
Description
companyHandle
xsd:string
Yes
The handle to the company with the asset you want to work with.
assetHandle
xsd:string
Yes
The handle to the asset you want to work with.
autoColorCropOptions
types:AutoColorCropOptions
No
Compute crop rectangle based on color. See AutoColorCropOptions.
autoTransparentCropOptions
types:AutoTransparentCropOptions
No
Compute crop rectangle based on transparency. See AutoTransparentCropOptions.

Output (getAutoCropRectReturn)

Name
Type
Required
Description
xOffset
xsd:int
Yes
The starting left pixels coordinate of the computed crop region.
yOffset
xsd:int
Yes
The starting top pixel coordinate of the computed crop region.
width
xsd:int
Yes
Width of the computed crop region (in pixels).
height
xsd:int
Yes
Height of the computed crop region (in pixels).

Examples

Request

<getAutoCropRectParam xmlns="http://www.scene7.com/IpsApi/xsd/2012-07-31-beta">
  <companyHandle>c|3578</companyHandle>
  <assetHandle>a|3192146</assetHandle>
  <autoColorCropOptions>
    <corner>UpperLeft</corner>
    <tolerance>0.5</tolerance>
  </autoColorCropOptions>
</getAutoCropRectParam>

Response

<getAutoCropRectReturn xmlns="http://www.scene7.com/IpsApi/xsd/2012-07-31-beta">
  <xOffset>452</xOffset>
  <yOffset>66</yOffset>
  <width>1271</width>
  <height>1874</height>
</getAutoCropRectReturn>
4e9b9d8c-5839-4215-aa35-01b652869681