You are absolutley right snibgo!
I installed bc and now I'm able to use different n parameters
The thing is that I'm getting a different color count using "identify -format %k" than the n that I entered.
For instance, this is the origial image
http://i.imgur.com/MXzRsyd.jpg
identify -format %k original.jpg
27397
And after excecuting "./kmeans -n 5 original.jpg out5.jpg" i get this
http://i.imgur.com/U9CXwd0.jpg
identify -format %k out5.jpg
10370
10370 is very different from 5
After excecuting "./kmeans -n 2 original.jpg out2.jpg" i get this
http://i.imgur.com/ywc7Z7P.png
identify -format %k out2.jpg
3450
3450 is very different from 2
What am I doing wrong?
Thanks again!