Skip to main content

Portrait Surface Normals

Portrait Surface Normals API

To compute your images surface normals, our API is available at https://clipdrop-api.co/portrait-surface-normals/v1.

info

Our API focuses on portrait surface normals, so that any image pixel that is not part of a person will be ignored (ie, the normal will be pointing directly towards the viewer and encoded as (128,128,255)).

Result image will be a JPEG where each pixel value is the normal for that pixel. The red channel represents the X axis, the green channel represents the Y axis and the blue channel represents the Z axis.

The request must be an http POST and its body must be a multipart/form-data that has one image file:

  • image_file is the original image to process.
    • The original image should be a PNG, JPEG or WEBP file, with a maximum resolution of 25 megapixels and a max file size of 30 Mb.

In case of success:

  • the response body will contain an image containing the surface normals of your input image.
  • response mime type will be image/jpeg.
  • the response headers will include a x-remaining-credits property to tell you how many credits you have left and a x-credits-consumed property to tell you how many credits were consumed by your request.

In case of an error:

  • the response mime-type is application/json, the error type is indicated by the response status code and details are in the json body, ie
{ "error": "No api key provided" }

Authentication

Requests are authenticated with an API key. If you do not have one, you can get one here.

If your key has leaked, you can revoke it and request a new one in your account page.

Credits

1 successful surface normals API call = 1 credit.

Once logged in, you can claim 100 free Clipdrop APIs credits that you can use for development and debugging purposes. Once the 100 images have been consumed, further calls will be rejected.

If you need more credits, you can purchase more credits via the following link.

Quota / Rate limiting

By default, each API key has a limit of 60 requests per minute for the surface normals API. Please let us know if you'd like higher values.

Examples

curl -X POST https://clipdrop-api.co/portrait-surface-normals/v1 \
-H 'x-api-key: YOUR_API_KEY' \
-F image_file=@portrait.jpg \
-o result.jpg

Responses

The result image, e.g. 
Example result of an upscaled image

Examples of input and outputs

Input

Example of an input image for surface normals

Output

Example of a surface normals map

Support

Any question ? Contact us at contact@clipdrop.co or join the Slack community.