You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
the eraser + right-click to replace is the only way I found to actually replace background color with transparent color
after using eraser + right-click to get actual transparency, the editor will show the "transparent grid" properly, but on export to PNG, it will generate black instead of transparent color
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.
Open in directly in Aseprite (Open with... or drag and drop)
Verify that it is RGB mode
Try the eraser or bucket fill with transparent color => fills with secondary color
Select background color as primary color. Add transparent color to palette, select as secondary color. Use the eraser + right-click with big brush size to replace background with transparency => it works
Export PNG => background is now black
Try different Color modes and repeat
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:
Thanks for this report. Some comments:
Some PNG images were loaded with a Background layer (instead a regular transparent layer) according how the images were encoded.
When you have a Backgroud layer, all pixels on your canvas will be non transparent and the eraser tool will 'paint':
left click: the secondary color (bg color)
right click: only the primary color will be replaced with secondary color within applied eraser area.
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).
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
fixaseprite#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: