makecol15_dither(3)
π makecol15_dither β the Allegro manual, but make it bestie-coded π
okay so this is a page from the Allegro manual (yes, that Allegro, the game programming library, she's iconic, she's legendary π). Today's topic? makecol15_dither and her twin sister makecol16_dither. Let's get into it, no cap. β¨
β¨ NAME β¨
makecol15_dither, makecol16_dither β these two calculate a dithered 15 or 16-bit RGB value. Allegro game programming library, obviously. π¦
πΈ SYNOPSIS πΈ
#include <allegro.h>
int makecol15_dither(int r, int g, int b, int x, int y);
int makecol16_dither(int r, int g, int b, int x, int y);
like, that's the whole vibe right there π
π DESCRIPTION π
so bestie, here's the tea π: you give these functions both a color value AND a pixel coordinate, and they calculate a dithered 15 or 16-bit RGB value for you. That combo? That's the whole point. The coordinate matters, the color matters, they work together. main character energy fr fr.
Why would you even want this? Because it can produce better results when reducing images from truecolor to hicolor. That's the glow-up. That's the transformation arc. π
And here's the part where you don't even have to call these functions directly if you don't want to: hicolor dithering can be automatically enabled when loading graphics by calling the set_color_conversion() function. Like, for example:
set_color_conversion(COLORCONV_REDUCE_TRUE_TO_HI | COLORCONV_DITHER);
see how she just handles it for you? obsessed. π
Example:
int pixel1, pixel2;
/* The following two color values MAY be different. */
pixel1 = makecol16_dither(255, 192, 64, 0, 0);
pixel2 = makecol16_dither(255, 192, 64, 1, 0);
β οΈ notice that MAY is in ALL CAPS in that comment β because the same RGB input at two different coordinates genuinely might come back as two different values. That's the dithering doing its thing, not a bug. slay. π
β RETURN VALUE β
Returns the RGB value dithered for the specified coordinate. simple as that, bestie. π«Ά
π SEE ALSO π
go read those too, they're all connected, iykyk π§
and that's the page!! this was Allegro, version 4.4.3, and the whole thing is dated like the classic manual page it is β makecol15_dither(3), still serving looks since forever. πβ¨
later bestie, go dither some pixels π¦
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms