-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
[Feature requests] Useful rgbgfx behavior flags #575
Comments
Seconded. For comparison, when I wrote my own tool (pilbmp2nes.py, later rewritten in C as pngtochr), I didn't include
How would this work? Would the caller pass a BGP value and then the converter assign indices to RGB color values based on luminance (.30R+.59G+.11B)? |
From the
This proposed flag would skip step 1. So a hypothetical image where PLTE index 0 is RGB #000000, index 1 is #555555, index 2 is also #555555, and index 3 is #FFFFFF, would just be treated as a grayscale image with black, dark gray, and white; instead of turning index 0 into white, index 3 into black, and treating indexes 1 and 2 as separate grays. |
Does the concept of "indices appropriate to each shade" assume BGP=OBP0=OBP1=$E4 (%11100100, or 0 is white 1 is light gray 2 is dark gray 3 is black)? Because it appears steps 2 and 3 would fail with sprite cels containing opaque white. |
After some discussion, rather than the "skip embedded palette" flag, the following could be of use:
|
Proposed shortcut forms for specifying a grayscale palette on the command line, implying an appropriate fuzziness:
|
This is equivalent to what I just mentioned in another issue. |
For For the range, I'm thinking 0-255 integers, as it's what other numeric arguments use, and it can be essentially arbitrary. |
First, Second, input PNGs generally have 8-bit color depth while output palettes have 5-bit, so at the least I'd expect allowing fuzziness as a binary switch to just ignore the low 3 bits of R, G, and B. If the user wants even more fuzziness than that, it could be a number of low bits to drop, so 0 to 7 (or higher if they have a 16-bit-depth PNG for some reason). Alternatively, |
Currently, all channels are truncated to 8-bit before any comparison, and I'm reluctant to simply truncate to 5-bit due to color curves potentially requiring further conversion before such a truncation. The behavior I have in mind is, if the image contains too many colors, compute the fuzziness threshold that would make it valid; if it's "sufficiently close" (TBD) to the specified threshold, notify the user of it. |
That sounds fine. For specifying CLI palettes, can they be specified as 8-bit or 5-bit? So if the user supplies a PNG palette, those colors would have to be exact unless |
CLI palettes shall be specified either textually (in-line or from a file), or from a PNG file; in the latter case, colors can be specified exactly, and in the former, they shall be specified as 8-bit. (I'm not sure how to disambiguate an 8-bit spec from a 5-bit one, especially in I'm currently designing the palette input: either it's in-line My current design problems are:
|
RGB555 could just be specified as a single number, the 2-byte encoding as displayed in BGB's VRAM viewer. So (R=15,G=6,B=3) would be For inline palettes, I'd suggest a comma to separate the three/four channels if spaces separate the colors, or vice-versa. No need for parentheses. Then |
There's no point in specifying palettes as a whole in decimal, since all displays are either per-channel (either decimal or hex), or global in hex. Hence, I guess |
Explicit |
So: palettes = palette { ( ";" | "\n" ) { "\n" } palettes } ;
palette = color [ , color [ , color [ , color ] ] ] ;
color = "(" num num num [ num ] ")" | "#" rgba888 | "$" rgb555; What about the file ambiguities? |
Allowing only binary input for |
Would it be interesting to allow taking tiles as input, and only using those? I think this might be useful if a tileset has already been generated, and one wants to ensure that the generated tilemap matches that tileset. (E.g. if several maps share a given tileset, you'd want tile IDs to match the tileset's, not the image's own.) I had planned to also allow taking a tilemap as input, to allow finer control over duplication, but I'm less sure about the use cases for that. |
Taking an input tileset to generate a tilemap definitely sounds useful. Taking a tilemap as input is also potentially useful: there are a few places where pret uses gfx.c's |
It seems really specific: if you already know the tilemap, in which cases would you need to change the input image? If you don't change the image, there's no point in using RGBGFX, is there? |
Here are a couple examples:
You're right that it's a niche use case though. Plus neither of those goes with one single tilemap that could conveniently be used as |
Yeah, these look like use cases for matching disassemblies, which I'm not sure I want |
I've tried designing this feature, and it seems very difficult at least if a palette spec is not given; otherwise, So I think a first implementation should be fine if it required Additionally, I think there should be a "strict" mode where only the predefined tiles are allowed, and a "seed" mode where more tiles are allowed to be generated. Both seem like they should have use cases. |
I guess that depends on whether the "seed tileset" is provided as a PNG (has inherent colours, but may require its own set of processing flags), or as tile data (no colours, but easier to manipulate)... I'm leaning more towards the latter, personally. |
As discussed in gbdev#575 (comment)
As discussed in gbdev#575 (comment)
As discussed in gbdev#575 (comment)
Plan: |
As discussed in gbdev#575 (comment)
All we need to resolve this issue is |
As discussed in gbdev#575 (comment)
As discussed in gbdev#575 (comment)
Some of these points have been done, some have their own individual issues, and some (e.g. a list of tile indexes to preserve) will not be implemented. |
As discussed in gbdev#575 (comment)
As discussed in gbdev#575 (comment)
Most of these are provided by pret's tools/gfx.c post-processor for
rgbgfx
output.-m
omits both)-h
)PLTE
chunk)The text was updated successfully, but these errors were encountered: