Image Insights

Overview

Image Insights is one of the intelligence services of Filestack platform. You can detect interesing areas of the image and assess it’s overall saliency.

This task is only available at Filestack Workflows. Read more about Workflows here.

Workflows Task Configuration

In order to learn how you can use Workflows UI to configure tasks and logic items, please visit Creating Workflows Tutorial.

Image Insights task is available in Intelligence tasks category.

Workflows Parameters

PARAMETER VALUE OPTIONS DESCRIPTION
Task Name string Unique name of the task which will be included in the webhook response and can be used to build logic below.
Colormap stringjet jet viridis plasma gray red blue green Colormap to represent to saliency distribution on your image. You can use the colors listed in colormap options

Colormap Options

You can select one of the following colormaps to change the visual representation of detected saliency distribution.

Name Colors
gray
jet
viridis
plasma
red
green
blue

Logic

Image Insights task returns following response to the workflow:

{
  "data": {
    "insights": {
        "metrics": {
            "SaliencyLoad": 20426.744,
            "SaliencyPercent": 12.76,
            "CognitiveDemand": 26.96,
            "Brightness": 49.77,
            "RedLoad": 47.55,
            "GreenLoad": 49.63,
            "BlueLoad": 51.93,
            "Clarity": 70.03
        },
        "heatmap": "/9j/4AAQSkZJRgABAQAA..."
    }
  }
}

Logic Parameters

data dictionary Includes the information of image insights task.
insights dictionary Contains detected image information.
metrics dictionary Contains visual properties of the image.
heatmap bytes Contains base64 encoded heatmap image.

Considering the response from the task, you can build logic in order to make independent flows with different executing tasks. For example, if you would like to run another depending on the saliency level detected, you can use the following rule:

insights.metrics.SaliencyPercent gt 70.0 or insights.metrics.SaliencyPercent lt 20.0

In Workflows UI this command would be similar to the example below:

Visit Creating Workflows Tutorial to learn how you can use Workflows UI to configure your tasks and logic between them.

Webhook

Below you can find an example webhook payload for image insights task

{
    "id": 65374401,
    "action": "fs.workflow",
    "timestamp": 1551126197,
    "text": {
        "workflow": "c516549f-3755-4fb5-85a4-15ae4b31d475",
        "createdAt": "2020-01-25T20:21:53.929686791Z",
        "updatedAt": "2020-01-25T20:21:56.716186597Z",
        "sources": [
            "H2swKXwhRxKFrylakLwcd"
        ],
        "results": {
            "image_insights_1551120182170": {
                "data": {
                    "insights": {
                        "metrics": {
                            "SaliencyLoad": 20426.744,
                            "SaliencyPercent": 12.76,
                            "CognitiveDemand": 26.96,
                            "Brightness": 49.77,
                            "RedLoad": 47.55,
                            "GreenLoad": 49.63,
                            "BlueLoad": 51.93,
                            "Clarity": 70.03
                        },
                        "heatmap": "/9j/4AAQSkZJRgABAQAA..."
                    }
                }
            }
        },
        "status": "Finished"
    }
}

Please visit the webhooks documentation page to learn more.