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

Gif opening causes color reindexing when duplicate colors in color table #3426

Closed
domgetter opened this issue Jul 15, 2022 · 2 comments
Closed

Comments

@domgetter
Copy link

When Aseprite opens a gif which has a single global color table, it will re-index pixels in some of the frames when they share RGB values with other indices in the color table.

black_test_aseprite

In this gif, the palette is 256 copies of black, but the 2 frames are indexed to color 240 in the table. When Aseprite opens it, frame 1 is all indexed as 240, but in frame 2, all the pixels are re-indexed to 1 since it's also black.

Expected/preferred behavior: When Aseprite opens a gif with only a global color table, the colors are copied from the color table to the current palette, and the indices across all the frames are left alone and copied in as-is.

Aseprite and System version

  • Aseprite version: v1.2.34.1-x64, installer
  • System: Windows 10 Home
@domgetter
Copy link
Author

I understand things are more complicated when the gif has local color tables, and that Aseprite may from time to time be forced to convert everything to true color, but this issue is regarding a simpler case where the gif is almost just a list of indexed BMPs.

@Gasparoken
Copy link
Member

Thanks @domgetter for this report. I was able to reproduce it.

@Gasparoken Gasparoken added the wip label Jul 27, 2022
@Gasparoken Gasparoken removed the wip label Jul 28, 2022
Gasparoken added a commit that referenced this issue Aug 10, 2022
…r table (fix #3426)

If the RGB color at index 'i' of the local gif palette and the sprite palette match, there is no need to call findMatchColor(). This prevents indexes from being reassigned undesirably.
Also, in the special case that a global palette exists and as long as no local palette appears during frame iteration, it is not necessary to call findMatchColor() since the global palette is equal to the sprite's palette (in colors and order).
@dacap dacap closed this as completed in fbf6240 Oct 11, 2022
@dacap dacap modified the milestones: v1.3-betas, v1.3.0-rc1 Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants