I have a image that I've logically separated into a 100 by 100 grid. In each cell of the grid, I want to find the most commonly occurring color. My current algorithm uses a hash map to calculate the mode in linear time, but processing the whole image still takes a ridiculous amount of time!
I'm working on a little game that is grid based, and I wanted to allow the players to import an image to color the grid after.
Is there a better algorithm out there that I should know about?