Exporting Slices Corrupts RGB Values for Zero-Alpha Pixels
Describe the bug Using the script to export slices causes the edgemost pixels outside the sprite's non-zero alpha to have corrupted RGB values. This is an issue when applying premultiplied alpha in rendering the exported slices.
To Reproduce
- Download the sprite with slices here: https://drive.google.com/file/d/1VL9wc6WL6vdYmgr4vBl40FI3NwAyiDZQ/view?usp=sharing
- Export the slices of the sprite manually.
- Export the slices of the sprite by using the script
export_slices. - Observe the RGB values of the two versions, near the visible edges of the exported slices.
- Observe the manually exported slices correctly having zero RGB (0, 0, 0) for zero alpha.
- Observe the scripted exports having non-zero RGB for the same pixels.
Expected behavior The scripted export should be identical to the manual export in terms of RGB values for the pixels.
Screenshots
System Information:
- Windows 11
- Aseprite version v1.3.7-x64
-
export_slices - Script commit: 2424a1f005cb7734ba6321c89e29b57f8d228716
Additional context
This is an issue when applying premultiplied alpha in rendering the exported slices.
Premultiplied alpha is precisely the technique that remedies this issue. Did you mean to say bilinear interpolation?
Either way this appears to be outside of the control of the script, which just says "save this area of the image to a file" from where Aseprite takes over.
This is an issue when applying premultiplied alpha in rendering the exported slices.
Premultiplied alpha is precisely the technique that remedies this issue. Did you mean to say bilinear interpolation?
Either way this appears to be outside of the control of the script, which just says "save this area of the image to a file" from where Aseprite takes over.
Yes, you're correct. I was able to workaround the issue but modifying the Lua files locally - I'll check if I still have the modified files around, in case they're useful. I think they had to do with the resizing done in the script.
This looks like an issue with the Aseprite export API. Can you confirm if it still happens in the latest Aseprite version? If it does, please create a PR.