Binary Image Library
|
#include <stdlib.h>
#include <assert.h>
Functions | |
unsigned char * | randomhalftone (unsigned char *grey, int width, int height) |
unsigned char * | floydsteinberg (unsigned char *grey, int width, int height) |
unsigned char * | stucki (unsigned char *grey, int width, int height) |
unsigned char * | ordereddisperseddot (unsigned char *grey, int width, int height, int order) |
unsigned char * | orderedclustereddot (unsigned char *grey, int width, int height, int order) |
Halftone functions.
Half toning is when we represent a greyscale iamge as a binary image, using filters and dithering to give a visual representation of the grey.
unsigned char* floydsteinberg | ( | unsigned char * | grey, |
int | width, | ||
int | height | ||
) |
Halftoning with Floyd-Steinberg error diffusion.
grey | - the greyscale image |
width | - image width |
height | - image height |
unsigned char* orderedclustereddot | ( | unsigned char * | grey, |
int | width, | ||
int | height, | ||
int | order | ||
) |
Ordered clustered dot dithering.
[in] | grey | - the greyscale image |
width | - image width | |
height | - image height | |
order | - 3, 4, or8 |
NB : The predefined dither matrices are the same as matrices used in the Netpbm package (http://netpbm.sourceforge.net) and are defined in Ulichney's book. See also : The newsprint web site at http://www.cl.cam.ac.uk/~and1000/newsprint/ for more technical info on this dithering technique
unsigned char* ordereddisperseddot | ( | unsigned char * | grey, |
int | width, | ||
int | height, | ||
int | order | ||
) |
Ordered dithering with a Bayer matrix of size 2^order by 2^order.
grey | - the greycale image |
width | - image width |
height | - image height |
order | - size of matrix (1-4) |
unsigned char* randomhalftone | ( | unsigned char * | grey, |
int | width, | ||
int | height | ||
) |
Halftoning with random dither.
grey | - the greyscale image |
width | - image width |
height | - image height |
unsigned char* stucki | ( | unsigned char * | grey, |
int | width, | ||
int | height | ||
) |
Halftoning with Stucki error diffusion.
grey | - the greyscale image |
width | - image width |
height | - image height |