Skip to content

Celiagg and Image backend have different inital state #1047

@corranwebster

Description

@corranwebster

It looks like the Celiagg backend starts out with a completely transparent image, but the Image/agg backend starts out filled with white. It looks like Quartz and Cairo also start out transparent, QPainter doesn't initialize to anything, so Agg is probably the odd-one out.

Celiagg initializes with zeros:

buffer = np.zeros(shape, dtype=np.uint8)

Agg initializes with 255:

pixel_map = PixelMap(
width,
height,
pix_format_string_map[pix_format],
255,
bool(bottom_up),
).set_bmp_array()

Activity

corranwebster

corranwebster commented on May 5, 2023

@corranwebster
ContributorAuthor

This is causing test failures for the Chaco test suite when run with non-agg backends: enthought/chaco#891

corranwebster

corranwebster commented on May 5, 2023

@corranwebster
ContributorAuthor

Work-around is to explicitly call gc.clear() before drawing anything in tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Celiagg and Image backend have different inital state · Issue #1047 · enthought/enable