Help Center/ Object Storage Service/ Image Processing (Paris Region)/ Obtaining Average RGB Value of an Image
Updated on 2024-02-29 GMT+08:00

Obtaining Average RGB Value of an Image

You can obtain the average RGB value of an image by making an API call only.

This operation enables you to obtain the average RGB value of an image, which is returned as a hexadecimal value in JSON format.

Operation name: average-hue

Example

You can access the following address through a web browser and obtain the average RGB value of the example.jpg image:

https://obs.region.example.com/image-demo/example.jpg?x-image-process=image/average-hue

If information similar to the following is displayed, the average RGB value of the image is obtained successfully:

{"RGB":"#28577D"}

The original image of example.jpg is as follows:

The obtained average RGB value (#28577D) is: