SKETCH API Endpoint

Version 2.197 (Release Notes ↗)

Description

Simulates a pencil sketch. The image is convolved with a Gaussian operator of the given radius and standard deviation sigma. For reasonable results, radius should be larger than sigma. Ignore the radius parameter and this API endpoint will select a suitable radius for you. Angle gives the angle of the blurring motion. Simulates a pencil sketch by convolving the image with a Gaussian operator. Adjust the radius and sigma for optimal results. The angle parameter controls the blurring motion. Ideal for developers and creators looking to enhance image effects.

HTTP Methods

GET, POST

HTTP Parameters

Required

Fields Type Description
img URL Input image URL. If uploading directly from your app, submit a multipart/form-data POST request.
radius Float Gaussian radius in pixels (max 30.00).
sigma Float Gaussian standard deviation in pixels (max 100.00).
angle Float Effect angle in degrees (max 360.00).
key String Your PixLab API Key ↗. Alternatively, embed it in the WWW-Authenticate: header.

Optional

Fields Type Description
blob Boolean Returns image binary contents instead of JSON when set to true.

POST Request Body

For direct image uploads instead of GET requests.

Allowed Content-Types:

  • multipart/form-data
  • application/json

Use multipart/form-data for direct uploads (see examples). For JSON, the image must be pre-uploaded (use store endpoint first).

HTTP Response

Fields Type Description
status Integer Status code 200 indicates success, any other code indicates failure.
link URL Link to the image output which is usually stored on the pixlab.xyz storage server unless you set your own S3 keys (refer to your dashboard ↗ on how to do that).
id String Unique image ID.
error String Error message if status != 200.

The API returns application/json if the optional blob parameter is not set.

This endpoint returns a JSON Object after each call only if the optional blob parameter is not set. Otherwise the image binary contents is returned directly.

Code Samples

# Refer to the PixLab Github Repository at: https://github.com/symisc/pixlab for the full list of production ready code samples...
← Return to API Endpoint Listing