I have a bunch of products on a page with 200x200 images. My first start is getting data for each pixel (nested loop, one for x, one for y), then converting rgb to hex and storing it in an array, and then getting the most frequent. This script should run 96 elements per page at a time.
Currently, he creates a canvas and places the product image on this canvas, and then performs the above operations.
Is there some kind of averaging algorithm that will make this faster?
source
share