Skip to content

Find the round shapes in a picture

GET
/v1/assets/{id}/round-shapes
curl --request GET \
--url https://api.pixonaut.app/v1/assets/example/round-shapes \
--header 'Authorization: Bearer <token>'

Operation ID: assets.roundShapes.get

The circles and rings a picture holds, such as a photo frame or a badge, read from its edges: each one’s centre and radius as fractions of the picture, and, given an artwork’s ratio, where it lands with the picture as that artwork’s background. A shape partly hidden still counts when most of its edge shows; an oval or a square does not.

id
required
string
ratio

An artwork’s aspect ratio as w:h (3:4): each shape is also placed where it lands with the picture as that artwork’s background at its default fit, cover.

string
/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/

An artwork’s aspect ratio as w:h (3:4): each shape is also placed where it lands with the picture as that artwork’s background at its default fit, cover.

The round shapes found

Media typeapplication/json
object
heightPx
required
integer
shapes
required

The round shapes found, the largest first: in fractions of the picture, and on the artwork.

Array<object>
object
center
required

The centre, as fractions of the width and height.

object
x
required
number
y
required
number
innerRadius
required

A ring’s inner edge’s radius; null for a disc or a circle.

object
h
required
number
w
required
number
onArtwork
required

The shape on the artwork asked for with ratio, in fractions of the artwork, ignoring the few millimetres of a print’s bleed; null without ratio.

object
box
required

The square round the outer edge, as fractions of the artwork from its top-left corner: a layer’s offset and size that ring the shape.

object
h
required
number
w
required
number
x
required
number
y
required
number
center
required

The centre, as fractions of the width and height.

object
x
required
number
y
required
number
innerRadius
required

A ring’s inner edge’s radius; null for a disc or a circle.

object
h
required
number
w
required
number
radius
required

The outer edge’s radius.

object
h
required
number
w
required
number
radius
required

The outer edge’s radius.

object
h
required
number
w
required
number
widthPx
required
integer

Examples

Exampleexample

Example

{
"heightPx": 4000,
"shapes": [
{
"center": {
"x": 0.5,
"y": 0.425
},
"innerRadius": {
"h": 0.16,
"w": 0.2133
},
"onArtwork": {
"box": {
"h": 0.4,
"w": 0.5333,
"x": 0.2333,
"y": 0.225
},
"center": {
"x": 0.5,
"y": 0.425
},
"innerRadius": {
"h": 0.16,
"w": 0.2133
},
"radius": {
"h": 0.2,
"w": 0.2667
}
},
"radius": {
"h": 0.2,
"w": 0.2667
}
}
],
"widthPx": 3000
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: unauthorized

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: origin_forbidden, forbidden, feature_disabled, workspace_suspended

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: not_found

Media typeapplication/json
object
error
required
string

Examples

Examplenot_found

not_found

{
"error": "not_found"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: not_a_picture, invalid_query

Media typeapplication/json
object
error
required
string

Examples

invalid_query

{
"error": "invalid_query"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: db_error. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Questions? Write to [email protected].

Status · Terms of service · Privacy policy · Subprocessors