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

Conversion RGB to INDEXED color mode always picks index 0 as transparent color #3207

Open
Gasparoken opened this issue Mar 16, 2022 · 1 comment
Labels
feature Feature request, or something should be improved low priority time-2
Milestone

Comments

@Gasparoken
Copy link
Member

Even if mask color is present in the palette:

Screen Shot 2022-03-16 at 10 36 37

In case of mask color isn't present the default behavior is:
Screen Shot 2022-03-16 at 14 51 56

Proposal behavior of INDEXED conversion:

  • The editor must review if the mask color is present in the palette:
    ... Yes: transparent color index will be defined.
    ... No: add the mask color at the beginning of the palette and define transparent color as index 0.

I think this option is better because the drawing is not modified in any case and is more intuitive (for me). It's an automatic way to do '2' on this comment: #2178 (comment)

Please give your impression 👍 or 👎 to this alternative behavior.

  • Aseprite version: 1.2.34.1
  • System: MacOS
@Gasparoken Gasparoken added feature Feature request, or something should be improved low priority time-2 labels Mar 16, 2022
@Gasparoken Gasparoken added this to the v1.2-stable milestone Mar 16, 2022
@Gasparoken Gasparoken added the wip label Jul 1, 2022
Gasparoken added a commit that referenced this issue Jul 5, 2022
… arragement.

This gives more accuracy in the color picking criteria on new images pasted into an INDEXED sprite.

Also, added findMaskColor to fix the behavior reported: #3207

Both issues are related when RGBMAP is created. The 'mask color' and 'mask index' must be defined correctly to include/exclude during the table/octree map color search.

To do: Converting sprite to INDEXED should add 'mask color' to the palette when color count <256 and transparent color isn't in the palette.
@Gasparoken Gasparoken removed the wip label Jul 5, 2022
@Gasparoken
Copy link
Member Author

Gasparoken commented Jul 5, 2022

Proposal changes just pushed.

Pending to add the mask color at the beginning of the palette only if the palette has color count <256, as default: define transparent color as index 0.

Pending to add tests to detect this issue for future integration tests.

Gasparoken added a commit to aseprite/tests that referenced this issue Jul 6, 2022
Before the fix for aseprite/aseprite#3207, Conversion RGB to INDEXED color mode, in transparent layers, always picks index 0 as transparent color, even if the mask color is present in the palette.
dacap pushed a commit to dacap/aseprite that referenced this issue Jul 14, 2022
…or arragement

This gives more accuracy in the color picking criteria on new images
pasted into an INDEXED sprite.

Also, added findMaskColor to fix the behavior reported in aseprite#3207

Both issues are related when RGBMAP is created. The 'mask color' and
'mask index' must be defined correctly to include/exclude during the
table/octree map color search.

To do: Converting sprite to INDEXED should add 'mask color' to the
palette when color count < 256 and transparent color isn't in the
palette.
dacap pushed a commit to aseprite/tests that referenced this issue Jul 14, 2022
Before the fix the conversion from RGB to INDEXED color mode, in
transparent layers, always picked index 0 as transparent color, even
if the mask color was present in the palette.
@dacap dacap modified the milestones: v1.2-stable, v1.3.x Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request, or something should be improved low priority time-2
Projects
None yet
Development

No branches or pull requests

2 participants