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

βœ¨πŸ› Implement import sprites API and several fixes #26

Merged
merged 17 commits into from
Aug 13, 2023

Conversation

pleonex
Copy link
Member

@pleonex pleonex commented Aug 13, 2023

Description

Finally it's here. APIs to allow to import sprite images into their original format. For instance, import a set of PNG files into Nintendo DS format NCER. In order to achieve it, several features and bug fixes were required:

  • Fix issue reading some NCER files
  • Implement serialization of NCER (Ncer2Binary) and related subtypes.
  • Implement image segmentation algorithm similar to requirements for NDS.
  • Fix drawing sprites when different layers not taking into account IDs
  • Fix serialization of NCLR causing skipping some colors
  • Update CLI to import sprites
  • Update CLI to export individual sprite cells
  • Improve FixedPaletteTileQuantization:
    • Return palette indexes for each tile
    • Set transparency to 255 if we are using transparent color
    • Avoid using transparent color for non-transparent pixels (when the RGB components are the same)
    • Fix finding best palette when having transparent color

Small changes

  • Cell names have the index padded to 3 digits.
  • NCGR: improve perf by saving swizzling in some cases
  • Create empty test project
  • Add documentation to some APIs
  • Add debugger viewer to some APIs
  • Quantization APIs return a type instead of a tuple

Example

Due to the complex nature and different use cases, there isn't a class that does the process. Check out how it's done for the Nitro formats (src\Texim.Tool\NitroCommandLine.cs in ImportSprites). In the future we may consider creating this class for some generic use cases.

@pleonex pleonex added the enhancement New feature or request label Aug 13, 2023
@pleonex pleonex added this to the vNext milestone Aug 13, 2023
@pleonex pleonex self-assigned this Aug 13, 2023
@pleonex pleonex marked this pull request as ready for review August 13, 2023 10:32
@pleonex pleonex merged commit b1e1743 into main Aug 13, 2023
5 checks passed
@pleonex pleonex deleted the feature/import-sprites branch August 13, 2023 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant