-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Opacity 255 in Alpha Compositing to Behave as Simple Ink #3047
Comments
@dacap I want to ask you about this behavior. In this screenshot I attached, there is a palette that has seven (7) identical colors at different indexes
So we now have the following sequence:
Of course, the last value is the only value that'd be retained in the map. So when we try to paint a region on the sprite with the first color in the palette, using the TransparentInkProcessing<IndexedTraits>, what we end up using is the color at index 15. So the Eyedrop's behavior is correct. My question: is this a bug or the expected behavior? I can't tell which it is. |
@iamOgunyinka I would say that this is a bug. In transparent layers we could expect to map RGBA=0,0,0,255 to the first match in the palette instead of the last one, e.g. in the original example it's 0 for background layers, and index 4 for transparent layers (but never entry 15 as there are other colors in the palette that matches first). Anyway the "Alpha Compositing" is a little strange in indexed mode, I think that if there is no alpha composition involved (all opacity is 255), and the active color is index, it should just paint the selected index color (so if we have index 15 selected with "Alpha Compositing", it should paint with index 15, not with 0 or 4, this means that we should use just About the generation of the octree here, probably changing the order at which palette indexes are processed might fix part of the problem: for (int i=palette->size()-1; i>=0; i--) {
if (i == maskIndex) {
m_root.addColor(palette->entry(i), 0, &m_root, maskColorBestFitIndex, 8);
continue;
}
m_root.addColor(palette->entry(i), 0, &m_root, i, 8);
} Maybe @Gasparoken can say something about it. @KasumiArai about this case, you can workaround the issue using the old (v1.2) RGB color mapping instead of octree: |
Hi @iamOgunyinka and @dacap. Will investigate it. |
For example, assume a sprite in Indexed Color Mode with a Background layer, and it has a palette with white as 'transparent' index, green, dark green and semitransparent black: On ink type = On the other hand, on ink type = I saw when we painting with the Transparent Index color in I'm testing this change (but I'll review octree scheme too (tomorrow). |
Thanks @iamOgunyinka! Yeah, you're right, the octree creation process is from the lower to the higher palette index, and each added color overwrites the previous correspondence INDEX <-> COLOR. I'll change this behavior as @dacap said. Finally, thanks @KasumiArai for this report! |
… in Alpha Compositing to behave as Simple Ink (fix #3047)
… in Alpha Compositing to behave as Simple Ink (fix #3047)
I'm closing this issue but I think still some work to add colors in the octree in reverse order should be done. |
Open this file:
Eyedrop the black in the top left corner of the image in color+alpha mode. Index 15 is selected.
Click index 0 in the palette to select it as the foreground color.
Fill the black in the top left corner of the image with the foreground color with Alpha Compositing ink and alpha 255.
Eyedrop the black in the top left corner of the image. Index 15 is still selected. The expectation was for it to be filled with the same color index.
GIF of this case:
Aseprite 1.3-beta7-x64 Steam
Windows 10
It works as expected in Aseprite 1.2.30-x64 Steam on Windows 10.
It also works as expected with the other blacks in the palette that are not index 0 in Aseprite 1.3-beta7-x64 Steam
I understand the need to color match after compositing for semi transparent brush colors, but this current behavior confused me
The text was updated successfully, but these errors were encountered: