Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Hello, I am using png2asset on a png file that contains only black on white
png2asset "./assets/text.png" -c "src/graphics/text.c" -spr8x8 -tiles_only -noflip # noflip because W is a reversed M
The generated tiles are however not black on white but grey on white (#aaaaaa)
const uint8_t text_tiles[608] = { 0x00,0x00,0x3c,0x00, 0x66,0x00,0x66,0x00, 0x66,0x00,0x66,0x00, 0x3c,0x00,0x00,0x00, 0x00,0x00,0x18,0x00, 0x38,0x00,0x18,0x00, 0x18,0x00,0x18,0x00, 0x3c,0x00,0x00,0x00, 0x00,0x00,0x3c,0x00, 0x4e,0x00,0x0e,0x00, 0x3c,0x00,0x70,0x00, 0x7e,0x00,0x00,0x00, ...
when I put a grey pixel anywere in the source png file, the text is black.
Is it a known issu with png2asset or did I missed a flag ?
Last edited by drev (2023-11-12 16:04:39)
Offline
1. why do you use the metasprite mode, while it is much better to use the tilemap mode (-map, not -spr8x8)?
2. you can use indexed PNG with only 4 colors and use -keep_palette_order.
Last edited by toxa (2023-11-13 07:28:04)
Offline
Thank you, it worked using -keep_palette_order and indexed mode.
For information, under gimp I changed to indexed color mode using the image/Mode menu and selected 4 colors
https://docs.gimp.org/en/gimp-image-con … dexed.html
Since the image only have 2 colors the I had to manually add 2 more colors using the Colormap dialog
https://docs.gimp.org/en/gimp-indexed-p … ialog.html
Last edited by drev (2023-11-14 00:44:18)
Offline
yes, usually, when you have more or less large project with many assets, it is important to make conversion process predictable and same for all the images in the project. -keep_palette_order and indexed png images is the best way to achieve that
Offline