Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow image_frombuffer to understand cairos premultiplied ARGB32 #2972

Closed
@stuaxo

Description

@stuaxo

It would be good if image_frombuffer could understand pycairos premultiplied ARGB32 format, currently it seems impossible to use, as pygame is doing some byteswapping and it's not obvious how to enable alpha premultiplication.

In detail:

@hanysz found an interesting issue using pycairo to create surfaces for pygamepygobject/pycairo#247

Cairos ARGB32 format stores ARGB starting in the high byte, with alpha premultiplied.

Thedocs make it look like image_frombuffer should be able to handle this format, but unfortunately there is some
undesired byteswapping happening.

Theimplementation calls SDL_CreateRGBSurfaceFrom, which looks like it could be given the right parameters to understand the format.

@hanysz test prog creates an image in cairo, rendering text in red, green and blue and renders in pygame - but only the "red" text is output, in blue:

image

The feature request:

Possibly this needs a new format: native endian RGBA32 with alpha premultiplication, or maybe it's a matter of providing a method of disabling the byteswapping.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp