Skip to content

Conversation

@ClementPinard
Copy link
Contributor

Make the ImageRegressionFixture compatible not only with bytes but also with direct PIL.Image.Image objects.

Most of the time when I use it, I have to convert my images to bytes only for them to be loaded back to PIL.

This PR tries to make it easier for people not familiar with bytes and image conversion

Clément and others added 3 commits December 16, 2025 18:20
Added release notes for version 2.9.0, including support for PIL.Image in ImageRegression.check.
@nicoddemus
Copy link
Member

Thanks @ClementPinard, appreciate the PR!

Could you please fix the tests? Thanks!

@nicoddemus
Copy link
Member

nicoddemus commented Dec 18, 2025

The parametrization in the test caused the expected files to change... could you fix that? Thanks!

@prusse-martin
Copy link

The parametrization in the test caused the expected files to change... could you fix that? Thanks!

Given the image data has not changed a simple image_regression.check(image_data, diff_threshold=1.0, basename='test_image_regression') would possibly work.

@ClementPinard ClementPinard force-pushed the feat/regression_pil_images branch from 5e8ca73 to 9b8c67e Compare January 5, 2026 14:15
@ClementPinard
Copy link
Contributor Author

The parametrization in the test caused the expected files to change... could you fix that? Thanks!

Given the image data has not changed a simple image_regression.check(image_data, diff_threshold=1.0, basename='test_image_regression') would possibly work.

Thanks ! I initially created two new images, one for each parametrized test, but your solution is indeed much simpler.

@nicoddemus nicoddemus merged commit 058cab0 into ESSS:master Jan 5, 2026
11 of 13 checks passed
@nicoddemus
Copy link
Member

Thanks! The Python 3.9 failure is unrelated and will be fixed in a separate PR.

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.

3 participants