Skip to content

ECT can change opaque pixels to transparent when optimising PNG files to RGB + tRNS based alpha #110

Closed
@NeRdTheNed

Description

@NeRdTheNed

Tested on MacOS with ECT 0.9.3.
Here's an image that demonstrates this bug (originally from here):
creative_motor
It's an indexed PNG with a tRNS chunk, which has two different palette entries for black. The first entry is set to be transparent with the tRNS chunk, and the other entry remains fully opaque. When ECT optimises it, it converts it to truecolor (RGB) with a tRNS chunk. The tRNS chunk now sets all instances of the color black to fully transparent, which results in some previously opaque pixels becoming transparent:
creative_motor_ect
I'd suggest that when --strict is passed, PNG files are not converted to RGB + tRNS based alpha if it would result in this issue occurring. When --strict is not passed, lossy transparency optimisations could be used to change the color of the transparent pixels to avoid this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions