meltingice / CamanJS

Javascript HTML5 (Ca)nvas (Man)ipulation
http://camanjs.com
BSD 3-Clause "New" or "Revised" License
3.55k stars 404 forks source link

Ability to reduce the amount of colours used in an image #64

Open balupton opened 11 years ago

balupton commented 11 years ago

Say I'm working with an image which has 2 million colours, however it is for a destination that only supports 6 or 8 or 10 or whatever. It would be nice if there was the ability to be able to reduce the canvas to only have the set amount of colours.

This seems similar to the way the current "clip" filter works, however unlike clip where colours will turn white if they are not popular enough, instead with this, the colours will be merged into the remaining colours. E.g. pink, magento will be replaced by the more generic red if the only colours that are allowed are red, green and yellow.

Thoughts?

meltingice commented 11 years ago

This would certainly make for a very cool plugin. There are some scripts out there that do something similar to this and could be ported over to CamanJS.