Skip to content

Distinguish premultiplied alpha vs non-premultiplied alpha #4

@nigeltao

Description

@nigeltao

Feature request: have the pfg tool and/or the docs state whether various formats-with-alpha use premultiplied (associated) or non-premultiplied (unassociated) alpha.

For example, https://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-format-t states that CAIRO_FORMAT_ARGB32 uses premultiplied alpha. Quoting from that link: "50% transparent red is 0x80800000, not 0x80ff0000".

Is CAIRO_FORMAT_ARGB32 equivalent to SDL_PIXELFORMAT_ARGB8888 (in terms of alpha semantics, not just byte order) or would I have to do a "premul to non-premul" conversion? I think that's the sort of question that's within the Pixel Format Guide's scope.

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