dimanche 5 avril 2015

Generate limited size colour palette for image data [textures/images]

How can I generate a palette of 16 colours and a palette of 256 colours from an image that will be different sizes.


Is there any function or formula out there that can do this?


The palette doesn't have to use all 16 or 256 colours.


It's not a problem if the image data only uses 16 different colours when generating a 16 colour palette, but there is very likely to be more of course.


I don't mind which scripting/programming language the code is in.


I've checked this post, but I don't want to use a massive library, which I'm guessing Qt is. What would be a good algorithm to convert an image to a limited size color palette


And this post doesn't take into account a maximum count of colours in the palette. Generate colour palette from an image


Aucun commentaire:

Enregistrer un commentaire