I need to reduce the colors in an image to a specified X number of colors.
I thought it would be quite simple with OpenCV but I was unable to find anything "ready-made", and the solutions proposed on the net were more about DYI from scratch. I don't understand why this issue has to be so complicated.
So I am asking here, what would be the simplest/fastest way to reduce the number of colors in an image to X, and then save it in an indexed PNG?
I tried kmeans
on a mobile device, using OpenCV for iOS, but it takes more than 1 minute which is too long.