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

Allow RGBGFX to take an external palette specification #487

Closed
ISSOtm opened this issue Feb 26, 2020 · 8 comments · Fixed by #981
Closed

Allow RGBGFX to take an external palette specification #487

ISSOtm opened this issue Feb 26, 2020 · 8 comments · Fixed by #981
Labels
enhancement Typically new features; lesser priority than bugs rgbgfx This affects RGBGFX
Milestone

Comments

@ISSOtm
Copy link
Member

ISSOtm commented Feb 26, 2020

Rationale: everybody's having headaches regarding the "indexed PNG" thing. It makes sense, it should work properly, but tooling for it is in practice abysmal.

Proposal: support input palettes like SuperFamiconv. Input formats:

  • PNG (4 pixels/stripes)
  • Bin data (quadruplet of either RGB888 or RGB555 colors)
  • Text (CSS specs directly via CLI args)

Problem: how to make this work with CGB images?

@ISSOtm ISSOtm added enhancement Typically new features; lesser priority than bugs rgbgfx This affects RGBGFX labels Feb 26, 2020
@ISSOtm ISSOtm added this to the v1.0.0 milestone Feb 26, 2020
@Hawkbat
Copy link

Hawkbat commented Feb 26, 2020

Would it also be possible to make an "inferred palette" with the first four RGB values encountered?

@ISSOtm
Copy link
Member Author

ISSOtm commented Feb 26, 2020

That's already the case, with the inferred palette being sorted by brightness. But sometimes you want to have white in your sprites, for which this solution isn't satisfactory.

@Rangi42
Copy link
Contributor

Rangi42 commented Jul 24, 2020

GBA has 16 palettes of 16 colors each, rather than 8 of 4. pokeruby/pokeemerald sometimes have grayscale images, but other images are colored entirely with the first palette in a set. For example, https://github.com/pret/pokeemerald/blob/master/graphics/frontier_pass/tiles.png. So CGB images could do the same: let the input palette file specify 4xN colors for N palettes, and expect the input image to be either grayscale or colored with the first 4. In either case, indexing the input image wouldn't be necessary. (Although if two of the colors in the first palette are identical, the image would have to be grayscale to distinguish them.)

@ISSOtm
Copy link
Member Author

ISSOtm commented Sep 25, 2020

Suggested workflow after a lot of discussion: first, create a "default" palette—either by following the PLTE chunk if any, or by gathering all colors in the PNG otherwise. Then, if a palette is specified on the CLI, override.

Also useful: taking the spec both as a list of colors directly (--palettes 000,555,aaa,fff;012,345,678,9ab), or as a separate file (--palette @file)

Suggested: a --bgp shorthand? Maybe --dmg-pal instead, since it also works for OBJ palettes.

@Rangi42
Copy link
Contributor

Rangi42 commented Sep 25, 2020

--dmg-pal as shorthand for --palettes fff,aaa,555,000 would be convenient.

@ISSOtm
Copy link
Member Author

ISSOtm commented Sep 25, 2020

I meant --dmg-pal 0xE4, --dmg-pal 0x11100100. I considered accepting the RGBASM syntax directly, but $ is problematic on Linux, and % on Windows.

@Rangi42
Copy link
Contributor

Rangi42 commented Sep 25, 2020

Base-4 like rgbasm's "Gameboy graphics" numeric format would also be convenient (it matches with how you'd input graphics directly, and the four values are obvious). Maybe --dmg-pal G3210 since backtick would need escaping.

@ISSOtm
Copy link
Member Author

ISSOtm commented Sep 25, 2020

Or prefix-less?

@ISSOtm ISSOtm mentioned this issue May 7, 2022
13 tasks
@Rangi42 Rangi42 modified the milestones: v1.0.0, 0.6.0 Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Typically new features; lesser priority than bugs rgbgfx This affects RGBGFX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants