Color quantization/C: Difference between revisions

m
Replace <lang> by <syntaxhighlight> block so it's better formatted
(Fixed bug in C code)
m (Replace <lang> by <syntaxhighlight> block so it's better formatted)
 
Line 1:
[[file:Quantum_frog_dithered.png|200px|thumb]]This is a complete program that takes a PPM P6 image and a number, then writes out the image reduced to the number of colors to out.ppm. There is optional dithering, too, which doesn't make a whole lot of difference with say 64 colors or more. And with low colors, the quantization did such a good job of picking average colors that it actually hurts the dithering process.
<langsyntaxhighlight lang="c">#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
Line 366:
 
return 0;
}</langsyntaxhighlight>
1

edit