Find the round shapes in a picture
const url = 'https://api.pixonaut.app/v1/assets/example/round-shapes';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”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.
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.
Responses
Section titled “Responses”The round shapes found
object
The round shapes found, the largest first: in fractions of the picture, and on the artwork.
object
The centre, as fractions of the width and height.
object
A ring’s inner edge’s radius; null for a disc or a circle.
object
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
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
The centre, as fractions of the width and height.
object
A ring’s inner edge’s radius; null for a disc or a circle.
object
The outer edge’s radius.
object
The outer edge’s radius.
object
Examples
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}Headers
Section titled “Headers”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
object
Examples
unauthorized
{ "error": "unauthorized"}Headers
Section titled “Headers”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
object
The feature the tenant does not have. Always sent with feature_disabled.
Examples
feature_disabled
{ "error": "feature_disabled", "feature": "api"}forbidden
{ "error": "forbidden"}origin_forbidden
{ "error": "origin_forbidden"}workspace_suspended
{ "error": "workspace_suspended"}Headers
Section titled “Headers”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
object
Examples
not_found
{ "error": "not_found"}Headers
Section titled “Headers”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
object
Examples
invalid_query
{ "error": "invalid_query"}not_a_picture
{ "error": "not_a_picture"}Headers
Section titled “Headers”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
Examples
db_error
{ "error": "db_error"}Headers
Section titled “Headers”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].