I just finished to implement the NeuQuant algorithm for quantization of 24/32 bit images to 256 colors, and I added the ability to run a Floyd Steinberg or Sierra dithering on top of that.
The results are *very* good in my opinion. Maybe not all are interested in 8 bits image nowadays, but they still have their place.
Well, here are some samples of the routines in actions. They are quite cpu intensive, but there are many levels of quality so you should find a compromise. Anyway this is about quality above all.
I still have to optimize some code... and write some comments...
[images removed]
Finished work --> here
Quantization to 256 colors
Quantization to 256 colors
Last edited by luis on Tue Nov 03, 2009 4:47 pm, edited 3 times in total.
"Have you tried turning it off and on again ?"
Re: Quantization to 256 colors, almost finished
It's amazing what can be done with 8-bit! I'll definitely be following this. Thanks for sharing. 
Re: Quantization to 256 colors, almost finished
Hehe, those from the old amiga (AGA) days can remember it well, as long you get 256 colors from a 16 millions color palette, you can do incredible picture with it.
Re: Quantization to 256 colors, almost finished
I was always fascinated by these things... probably it's the idea behind it... do a lot with less.
I would say I never saw a palette calculated so well, including in commercial programs like photoshop too.
They can get a comparable result (but in the end I prefer this), only using dithering and other techniques.
This code seem to beat them all in generating the best optimized palette, and this helps a lot later because the dithering has very little work left to do (less color errors to distribute), and this produce a much more pleasing final image.
I would say I never saw a palette calculated so well, including in commercial programs like photoshop too.
They can get a comparable result (but in the end I prefer this), only using dithering and other techniques.
This code seem to beat them all in generating the best optimized palette, and this helps a lot later because the dithering has very little work left to do (less color errors to distribute), and this produce a much more pleasing final image.
"Have you tried turning it off and on again ?"
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Quantization to 256 colors, almost finished
Good on you luis, I'm looking forward to seeing the code! If it's anything like your other shares it'll be well-written and excellent. Thanks for this 
BERESHEIT
Re: Quantization to 256 colors, almost finished
Thank you for the nice words netmaestro, I hope to wrap it up before the end of the week.
And thank you for sharing so much valuable code ...
And thank you for sharing so much valuable code ...
"Have you tried turning it off and on again ?"
Re: Quantization to 256 colors, almost finished
"Have you tried turning it off and on again ?"
Re: Quantization to 256 colors, almost finished
wow, really impressive results!


