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

Use explicit RGBGFX palette input for Pokemon and trainer sprites? #1134

Open
Rangi42 opened this issue Aug 27, 2024 · 0 comments · May be fixed by #1135
Open

Use explicit RGBGFX palette input for Pokemon and trainer sprites? #1134

Rangi42 opened this issue Aug 27, 2024 · 0 comments · May be fixed by #1135

Comments

@Rangi42
Copy link
Member

Rangi42 commented Aug 27, 2024

This is an alternative approach to #1079.

We currently rely on the Pokemon and trainer sprite PNGs to be encoded as indexed color, with a four-color palette in the correct order. This is an invisible property of the PNG that's easy to get wrong, and people don't always know to use palfix.py or have trouble using it.

RGBGFX supports explicit palette input, so instead of -c embedded, we would pass it -c "#ffffff,#abcdef,#123456,#000000" to use those four colors in that order.

This would not have to bloat the Makefile. Instead, each Pokemon's front.png+back.png and each trainer's sprite.png would have a corresponding .flags file, containing the "-c "..."" colors. Then the Makefile would be updated to use at-files:

gfx/pokemon/%/back.2bpp: gfx/pokemon/%/back.png gfx/pokemon/%/palette.flags
	$(RGBGFX) -Z @$(word 2,$^) -o $@ $<
gfx/pokemon/%/front.2bpp: gfx/pokemon/%/front.png gfx/pokemon/%/palette.flags
	$(RGBGFX) @$(word 2,$^) -o $@ $<

gfx/trainers/%.2bpp: gfx/trainers/%.png gfx/trainers/%.flags
	$(RGBGFX) -Z @$(word 2,$^) -o $@ $<

This would mean that when you create or edit a Pokemon or trainer sprite, whichever colors you use, you have to update the .flags file to use them too.

This avoids the problem #1079 had of not getting to see your colors used in the PNG. It also avoids the problem of having to update normal.pal colors in 5-bit RGB values, even though you almost certainly edit graphics with 8-bit RGB. (Dividing by 8 is less trivial than you'd think!) Finally, it avoids needing to care how your PNGs are encoded.

Rangi42 added a commit to Rangi42/pokecrystal that referenced this issue Aug 27, 2024
This avoids needing to define them via indexed PNG palettes

Fixes pret#1134
Rangi42 added a commit to Rangi42/pokecrystal that referenced this issue Aug 27, 2024
This avoids needing to define them via indexed PNG palettes

Fixes pret#1134
Rangi42 added a commit to Rangi42/pokecrystal that referenced this issue Aug 28, 2024
…eptions

This avoids the need to define their order via indexed PNG palettes

It also avoids the need to use tools/palfix.py on custom sprites

Fixes pret#1134
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

Successfully merging a pull request may close this issue.

1 participant