Currently the system to recover the colors of the image is not very accurate. The idea is to take the base image, create a virtual copy, crop it into a new 1x1 image and rely on sampling to get "the main color of the image".
This solution is not clean and is not very accurate either.
The new idea would be to resize the image to a size of ~150 pixels, parse each pixel and store their numerical values in an array SplFixedArray and sort on it to get the most common colors (array_count_values).
Currently the system to recover the colors of the image is not very accurate. The idea is to take the base image, create a virtual copy, crop it into a new
1x1image and rely on sampling to get "the main color of the image".This solution is not clean and is not very accurate either.
The new idea would be to resize the image to a size of ~150 pixels, parse each pixel and store their numerical values in an array
SplFixedArrayand sort on it to get the most common colors (array_count_values).