Image & Video APIs

Analyze assets

Last updated: Jul-08-2025

When uploading assets to your Cloudinary product environment, you can request different types of analysis to be performed on the assets. In addition to the functionality detailed below, Cloudinary has a number of add-ons that enable various types of analysis.

Page Description
Image quality analysis Determine the quality of images uploaded to your product environment.
Accessibility analysis Analyze your images for accessibility and select the best images for people with color blindness.
Semantic data extraction Extract additional semantic data from an image such as media metadata, pHash, ETag, color histogram, and more.
Media Inspector browser extension (Beta) Analyze your delivered images and videos in the browser to see the effect of the transformations and optimizations applied to the assets.
Analyze API (Beta) A method for analyzing any external asset and returning details based on the type of analysis requested.

Tip
You can also run your own analysis by specifying custom logic with JavaScript when uploading assets:
  • Evaluating and modifying upload parameters can be useful for conditionally adding tags, contextual metadata, structured metadata or eager transformations depending on specific criteria of the uploaded file. Your code will be evaluated before the file itself is uploaded.
  • Executing an update script can be useful for conditionally adding tags, contextual metadata, and structured metadata, depending on the results of using the detection parameter on upload. Your code will be evaluated after the file itself is uploaded.

Sample project: Computer vision demo

This sample project demonstrates using Cloudinary's analysis capabilities. The user can upload up to 3 images. Cloudinary analyzes the images and returns automatically transformed results along with a description. You'll see a message for images that don't pass moderation.

The image below shows sample output: two uploaded images analyzed for detected text, faces, orientation, and predominant colors. The transformations apply face masks, add borders based on the predominant color, and use a phone image as an underlay.

Go to the code
See the GitHub repo.

Setup instructions (after cloning from GitHub)

  1. Enable required add-ons

    Go to the Add-ons page of the Console Settings and enable:

    • Google Auto Tagging
    • OCR Text Detection and Extraction
    • Amazon Rekognition AI Moderation
  2. Create a virtual environment

  3. Activate your virtual environment

  4. Install dependencies

  5. Create a .env file

    Add the following environment variable:

  6. Replace placeholders

    Update the .env file with your Cloudinary credentials, which you can find in the API Keys page of the Console Settings.

  7. Update the cloudName value

    In index.html, replace the value for cloudName with your Cloudinary cloud name.

  8. (First-time only) Create the upload preset

    In demo.py, uncomment the following block inside the index() route the first time you run the app:

    Note
    Remember to replace the comments after the first run.
  9. Run the Flask app

Go to GitHub to try it out:

✔️ Feedback sent!

Rate this page: