Closed raysan5 closed 8 years ago
When converting our texture to a 16 bpp format, support Floyd-Steinberg dithering algorithm.
Related functions [textures.c]:
void ImageFormat(Image *image, int newFormat);
Dithering should be available (or automatically applied) when converting from UNCOMPRESSED_R8G8B8 or UNCOMPRESSED_R8G8B8A8 to the following formats:
UNCOMPRESSED_R8G8B8
UNCOMPRESSED_R8G8B8A8
UNCOMPRESSED_R5G6B5, // 16 bpp (no-alpha) UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha)
And additional function could be defined, here it is declaration proposal:
unsigned short *ImageDataDither(Color *pixels, int rBpp, int gBpp, int bBpp, int aBpp);
New function implemented:
void *ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp);
Merged in commit https://github.com/raysan5/raylib/commit/5dbb93dbb476c35d8f8aab24d9c3507640b171e8
When converting our texture to a 16 bpp format, support Floyd-Steinberg dithering algorithm.
Related functions [textures.c]:
Dithering should be available (or automatically applied) when converting from
UNCOMPRESSED_R8G8B8
orUNCOMPRESSED_R8G8B8A8
to the following formats:And additional function could be defined, here it is declaration proposal: