Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIL Image Kiva Backend #969

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

PIL Image Kiva Backend #969

wants to merge 9 commits into from

Conversation

corranwebster
Copy link
Contributor

This implements a basic Kiva pil_image backend using the PIL/Pillow ImageDraw routines (and related code). This is intended to be a reasonably complete reference implementation of Kiva that can be used if there are problems building the Agg backends.

There are some gaps due to limitations of the ImageDraw library:

  • no gradients, line dashes, line joins, line caps or choice between EOF/winding number fill
  • some gaps in the API where basecore2d doesn't implement things (eg. arc_to, stroke_rect/fill_rect, etc.; some of these are straightforward to implement, but it should be done in basecore2d)

But it does implement:

  • path drawing
  • image drawing
  • full font drawing, including rotation
  • rectangular clipping regions

And it includes some fixes/improvements to basecore2d that became apparent when writing the code.

There are likely corner cases, particularly in text rendering or when the expected behaviour is unclear. These can be fixed as needed if they aren't found in the review of the PR. It is about 50 times slower than the Agg renderers.

@corranwebster
Copy link
Contributor Author

Apparently we're tickling a bug in Pillow on Python 3.8 - the operation which is failing is pasting a single color into the image, so should be fine as it is very basic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant