Additional parameters
There are also parameters that controls level of jpeg compression and output image format.
quality
Integer value for the level of jpeg or webp compression.
output_format
The format of the output image: - jpeg - png - webp
max_file_size
Integer or string value with maximum file size. It supports "kb", "mb" and "gb" units. It is used with output_format equals jpeg or webp. When specified, Deep Image API tries to match highest possible jpeg quality and specified max_file_size.
safe
Boolean value that turns on NSFW filtering.
nsfw_parameters
Configuration of safe filter: - threshold (0-1 float value) - nsfw_image_url (optional image url returned when threshold is exceeded)
Output format, quality and max file size example:
{
"url": "image_url",
"width": 1000,
"height": 1000,
"output_format": "jpeg",
"quality": 85,
"max_file_size": "1MB"
}
Safe filter example:
{
"url": "https://deep-image.ai/api-example3.jpg",
"safe": true,
"nsfw_parameters": {
"thresold": 0.0,
"image_url": "https://deep-image.ai/api-example2.jpg"
}
}
This will return image specified in nsfw_parameters.image_url because safe filter threshold has been set to 0 (always fail)
Last updated