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
Downloaded PNG in RGB mode fails to support transparency: erase uses secondary color and export PNG replaces transparent color with black #4370
Comments
Thanks for this report. Some comments: When you have a Backgroud layer, all pixels on your canvas will be non transparent and the eraser tool will 'paint':
To work with pixels with alpha values, convert the 'Background Layer' to 'Layer': right click on Layer name, Convert to... > Layer Just in case: to select all the color you need to remove, the best tool is 'Magic Wand' with 0 Tolerance and Continuos unchecked on the context bar ('continuos unchecked' will remove isolated areas of color too). More info about Background Layer: https://aseprite.org/docs/layers#background-layer |
Based on your Repro steps, I see the inconsistency: there may be transparent pixels on a Background Layer, which should be prohibited. Then, in the export process, the alpha content of the pixels is discarded since the layer is a background layer. That's why it turns out 6. Export PNG => background is now black |
fix aseprite#4370) Before this fix, when working with sprites that included a background layer and using the Eraser tool, drawing transparent pixels was allowed if the secondary color was transparent + right click (i.e. eraser in replace mode "Primary color ->to-> Secondary"). Original issue aseprite#4370 description: "Downloaded PNG in RGB mode fails to support transparency: erase uses secondary color and export PNG replaces transparent color with black"
I often have this issue on images downloaded directly from the Internet, typically on The Spriters Resource. This happens when opening the PNG directly in Aseprite (not creating a new file then copying image rectangles). Note that opening a PNG sets the Color mode to RGB by default, so this is not an issue related to using Indexed Color mode (and even then, behavior differs from real Indexed Color mode).
Since spritesheets are often distributed with a transparency index color, I must manually remove the background color (by either using the magic wand + delete, paint bucket with transparent color or, when some background pixels are inside the sprites, the eraser + right-click to replace background color to transparent color (added myself to the palette).
However, I noticed the following:
It seems that somewhat the PNG metadata cannot be changed even after saving the file as an .aseprite file.
Switching to Indexed Color mode and back to RGB doesn't help. Switching to Indexed Color mode and defining background color as the index color doesn't work either. All 3 color modes have the issue.
Repro steps
Workaround
Create a brand new file in Aseprite in RGB mode, and copy image content from the PNG into that file, instead of opening the PNG itself in Aseprite.
Here is an example with a standard export on the left, and creating a new RGB file and copying content then exporting on the right:
Aseprite and System version
Other related threads
https://community.aseprite.org/t/my-eraser-draws-black-color-instead-of-erasing/2556/4
The text was updated successfully, but these errors were encountered: