gimp-tilemap-gb
gimp-tilemap-gb copied to clipboard
Problem with palette 4 colors.
Hello, when i open the placeholder file i found in gb-studio . I see only 4color ,but the plugin export gbm say that i have 5 colors. The export in .c seem to work correctly . But when i want to compile with gbdk-2020 i have some errors.
`main.c:309: syntax error: token -> 'guint' ; column 7 main.c:310: error 1: Syntax error, declaration ignored at 'guint' main.c:311: error 1: Syntax error, declaration ignored at 'guint' main.c:312: error 1: Syntax error, declaration ignored at 'guint8' make: *** [Makefile:29 : Example.gb] Erreur 1
the line in my file.c
guint width; guint height; guint bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */ guint8 pixel_data[160 * 144 * 3 + 1];
Thanks for your help
It may look like it only has 4 colors, but it might actually have 5 colors where two are close in appearance. You're welcome to post the image in this ticket.
What C file are you trying to compile with GBDK-2020?
Why are you using guint as a type? That's a GTK specific thing which isn't compatible with GBDK
Thanks for your answer. The file.c contain a export of file.png realize with gimp. The image is a empty background for gb-studio with only 4 colors https://ibb.co/7pHxyZp I want to convert a image.png to image.c usable with gbk-2020 Thanks
I read your answer on discord and i don't understand how to use png2asset. You have an example to convert a .png to gbdk ? I use img2gb and it work but only with 3 colors. Thanks
png2asset is part of GBDK-2020, and different from the tools in this repo (png2gbtiles). It will probably work better for you than the one in this repo, too.
png2asset
In order to use png2asset, here is the documentation:
- https://gbdk-2020.github.io/gbdk-2020/docs/api/docs_toolchain.html#autotoc_md96
- https://gbdk-2020.github.io/gbdk-2020/docs/api/docs_toolchain_settings.html#autotoc_md196
- The format is roughly
png2asset infile.png (options here if needed) -c outfile.c
And some example projects:
- https://github.com/gbdk-2020/gbdk-2020/tree/develop/gbdk-lib/examples/gb/metasprites
- https://github.com/gbdk-2020/gbdk-2020/tree/develop/gbdk-lib/examples/cross-platform/logo
png2gbtiles
However, if after that you still want to use png2gbtiles intead of png2asset then it works like this (adding any options necessary):
png2gbtiles input_file.png -csource outputfile.c
There are more details about it's options here: https://github.com/bbbbbr/gimp-tilemap-gb/tree/master/console
Thanks for your answer. The file.c contain a export of file.png realize with gimp. The image is a empty background for gb-studio with only 4 colors https://ibb.co/7pHxyZp I want to convert a image.png to image.c usable with gbk-2020 Thanks
If you want to share an image, you can just drag it into the comments. Please avoid using third party link storage services