Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with palette 4 colors. #8

Open
jackygoule opened this issue Jan 9, 2022 · 5 comments
Open

Problem with palette 4 colors. #8

jackygoule opened this issue Jan 9, 2022 · 5 comments

Comments

@jackygoule
Copy link

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

@bbbbbr
Copy link
Owner

bbbbbr commented Jan 10, 2022

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

@jackygoule
Copy link
Author

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

@jackygoule
Copy link
Author

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

@bbbbbr
Copy link
Owner

bbbbbr commented Jan 10, 2022

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:

And some example projects:

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

@bbbbbr
Copy link
Owner

bbbbbr commented Jan 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants