Requirement of our app is to have on image no more than precise number of colors. E.g. image has 10000 different colors, but on user settings we set maxColorCount = 10. It means that we should transform image to 10-colored image and then transform it to SVG due to requirements. On frontend side we detect colors on SVG and give users opportunity to change them to other ones. But I have good news. sharp transforms image to nearest color number that is power of 2. E.g. if i set 10 in options, sharp transforms in 16. And it means that values 9-16 give me the same result