Indexed graphics for retro engine?

Adam D. Ruppe destructionator at
Fri Sep 20 00:41:58 UTC 2019

On Thursday, 19 September 2019 at 03:47:05 UTC, Shadowblitz16 
> Is there a way to make a indexed graphics library that can 
> handle importing and exporting true color images?
> I would guess something like this could be simulated with 
> pointers and references right?

My color.d actually can do it.

it has a true color to indexed quantize function:

my png.d is capable of loading and saving them:

you will want to cast it to IndexedImage or cast it to 
TrueColorImage and quantize to get an indexed one.

and my simpledisplay.d knows how to display them, but it does so 
via conversions so palette swaps won't just work live like on a 
real DOS system or whatever.

all the module's source code are in here:

but otherwise the support is not great because it is just 
whenever I decide to answer emails and i'm gonna be busy this 
next week. but it might be useful to you

More information about the Digitalmars-d-learn mailing list