Skip to content

Alpha Channel Removal Issue When All Values Are 255 #419

@linkillhz

Description

@linkillhz

Hello,

I've encountered an issue with pngquant where the alpha channel is removed when all alpha values in the original image are 255 (completely opaque). After optimization, the output file no longer contains the alpha channel.

Issue Description

When I run pngquant on an image where every pixel's alpha value is 255, the resulting file seems to have the alpha channel completely removed. This behavior is unexpected because I would prefer to retain the alpha channel even if it is fully opaque.

Steps to Reproduce

Prepare a PNG image where every pixel's alpha value is 255.
pngquant --force --output optimized.png original.png
Check the resulting optimized.png file.

Actual Behavior

The alpha channel is removed, and the resulting image does not have an alpha channel.

Question

Is this the intended behavior when all alpha values are 255?
If so, is there a way to force pngquant to retain the alpha channel in the output file even when all alpha values are completely opaque?

Thank you for your assistance.

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