Nov 20th, 2017

Models / Type Detection

Type Detection


The image properties API can help you determine if an image is an illustration or a photography. An illustration could be a drawing, a clipart, a painting, a logo or any such image that does not look like a photography.

Illustration (logo)
Illustration (drawing)
Illustration (clipart)
Illustration (painting)

Type detection

The property detection does not use any image meta-data to determine the type of an image. The file extension, the meta-data or the name will not influence the result. The classification is made using only the pixel content of the image.


  • Require that users submit or upload real photos only, and not non-photographic content.
  • Group or classify your images depending on their type


  • Depending on the way they have been taken, photos of paintings / drawings may be detected as paintings or drawings and not as photos.
  • Some realistic illustrations (such as computer-generated scenes or realistic paintings) may be classified as photos.


The returned value is between 0 and 1, images with an illustration value closer to 1 will be an illustration while images with an illustration value closer to 0 will be a photography.

Illustration: (illustration value 0.80677)


The returned value is between 0 and 1, images with a photo value closer to 1 will be a photography while images with a photo value closer to 0 will be an illustration.

photography: (photo value 0.950306)

Use the model

If you haven't already, create an account to get your own API keys. You should then install the SDK that corresponds to your programming language. You can also implement your own logic to interact with our API if you prefer. Have a look at our API reference for more details.

# install cURL:

pip install sightengine

composer require sightengine/client-php

npm install sightengine --save

Detect the type of an image

Let's say you want to moderate the following image:

You can either upload a public URL to the image, or upload the raw binary image. Here's how to proceed if you choose to share the image's public URL:

curl -X GET -G '' \
    -d 'models=type' \
    -d 'api_user={api_user}&api_secret={api_secret}' \
    -d 'url='

 # if you haven't already, install the SDK with 'pip install sightengine'
from sightengine.client import SightengineClient
client = SightengineClient('{api_user}','{api_secret}')
output = client.check('type').set_url('')

// if you haven't already, install the SDK with 'composer require sightengine/client-php'
use \Sightengine\SightengineClient;
$client = new SightengineClient('{api_user}','{api_secret}');

// if you haven't already, install the SDK with 'npm install sightengine --save'
var sightengine = require('sightengine')('{api_user}','{api_secret}');
sightengine.check(['type']).set_url('').then(function(result) {
    // The API response (result)
}).catch(function(err) {
    // Handle error

The API will then return a JSON response:

  "status": "success",
  "request": {
    "id": "req_VjyxevVQYXQZ1HMbnwtn",
    "timestamp": 1471762434.0244,
    "operations": 1
  "type": {
    "illustration": 0.000757,
    "photo": 0.999243
  "media": {
    "id": "med_KWmB2GQZ29N4MVpVdq5K",
    "uri": ""

Any other needs?

See our full list of models for details on other filters and checks you can run on your images and videos.

Did you find this page helpful?

We're always looking for advice to help improve our documentation!

Let us know what you think

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more