Open timo opened 5 years ago
Perhaps a tiny macro system could be added. This would allow reuse of palettes, meta- and even pixel-data in multiple images...
I'm working on a cleaned-up reimplementation at https://github.com/cygx/p6-image-rgba
The new codebase supports palettes, via =palette
and =use
, cf https://raw.githubusercontent.com/cygx/p6-image-rgba/master/examples/letters.txt
oh, interesting!
btw Buf
has a splice
method, so you don't have to use nqp::splice
in the new code either :)
And with the next release of rakudo, there'll be read-int*
and write-int*
methods with little and big endian and everything, they should be pretty performant, too!
currently a
=img
directive will reset the mappings in a multi-image document. It is common to have shared palettes when doing pixel art, which Image::RGBA::Text is pretty good for.I could imagine either a
=gmap
directive just like=map
that adds mappings that will be re-applied for every new=img
, or a=palette <name> <mappings...>
that can be used even before the first=img
, perhaps when there are no mappings it would apply the named palette to the current image, or perhaps=savepalette <name>
and=usepalette <name>
could be a thing?