Skip to content

Use PIL Image everywhere, replace numpy arrays #352

@aydin-utting

Description

@aydin-utting
  • We use a mixture of PIL Images and numpy arrays
  • The colour channels are BGR for numpy arrays and RGB for PIL images (mostly) and this confusion leads to incorrectly rendered images
  • PIL images are probably the better choice, and they are arrays under the hood so it doesn't matter anyway.
  • The first place that we render an image is the PDFDocument render_page function which uses numpy arrays. We should replace this with PIL.Image and then propagate that change through to everywhere else.
  • We should replace the numpy array functions for cropping and rotating with PIL built in functions like PIL.ImageOps or just PIL.Image methods

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

This Sprint

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions