Programmable Media

Image quality analysis

Last updated: Apr-18-2024

You may want to determine the quality of images uploaded to your product environment, particularly for user generated content. If you set the quality_analysis parameter to true, a quality analysis focus score between 0.0 and 1.0 is returned indicating the quality of focus in the image. A score of 0.0 means the image is blurry and out of focus and 1.0 means the image is sharp and in focus.

You can request quality analysis while uploading an image, or by using the explicit method on an already uploaded image.

Quality analysis while uploading

You can request quality analysis while uploading by specifying the quality_analysis parameter in the upload method.

For example, uploading the "user_photo.jpg" image and requesting quality analysis:

Quality analysis on already uploaded images

You can request quality analysis after uploading by specifying the quality_analysis parameter in the explicit method.

For example, requesting quality analysis on the image with a public ID of "user1":

Tip
You can also use the Update details of an existing resource method of the Admin API to update uploaded assets. Admin API methods require your API key and secret, so they shouldn't be used in client-side code. They're also rate-limited, so should only be used in server-side code where you're managing bulk assets.

Sample response

Extended quality analysis

A more detailed quality analysis of uploaded images is available through extended quality analysis.

Important
Extended quality analysis is currently in Beta. Some implementation details may change before the official release. If you have a paid account, you can request to take part in the Beta trial. We invite you to share any feedback via our support team.

With extended quality analysis activated, the response to an upload or explicit request with quality_analysis set to true includes scores for different quality factors in addition to the normally available focus related score. An overall weighted quality score is also included:

  • Scores vary from 0.0 (worst) to 1.0 (best).
  • For multi-page images, only the first page is evaluated.
  • jpeg_* scores are only present for JPEG originals.
  • JPEG quality is considered best (1.0) if chroma is present for all pixels (no chroma subsampling).
  • Estimation of compression artifacts (DCT, blockiness and chroma subsampling) is not done for images above 10 MP
  • Resolution gives preference to HD (1920 x 1080) and higher.
  • pixel_score is a measure of how the image looks in terms of compression artifacts (blockiness, ringing etc.) and in terms of capture quality (focus and sensor noise). Downscaling can improve the perceived visual quality of an image with a poor pixel score.
  • color_score takes into account factors such as exposure, white balance, contrast and saturation. Downscaling makes no difference to the perceived color quality.

The quality_score, quality_analysis.color_score and quality_analysis.pixel_score fields can be used in the search method when quality_analysis is set to true in the upload request or an upload preset. Note that these scores are not indexed for search when returned as part of an explicit request.

✔️ Feedback sent!

Rate this page: