-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Updated EPS mode when opening images without transparency #8281
Conversation
I tried converting "1.eps" to PNG using ImageMagick, and it converted it to a 72x48 sized image. So perhaps Pillow isn't using the right size either. Not that there necessarily is a "right" size, since EPS isn't a raster image format. |
Mode "1" and "L" images should now load as those modes instead of being converted to RGB. "LAB" and "CMYK" are still converted to RGB though. |
This is reverting the change requested in #6382 (comment). I'm reluctant to change how Pillow behaves again just because a different third-party application was chosen to compare this against? |
I used ImageMagick because I don't have Photoshop, but I would consider Photoshop to be the one to follow, since EPS is an Adobe creation. I'll remove that commit. |
Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This lets Ghostscript choose the best device to use (pbmraw, pgmraw, ppmraw) based on the image data.
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My list of the changes in this PR.
- Raise an error if the "BoundingBox" is absent, even if "ImageData" is present
- Fix loading images where "BoundingBox" occurs after "ImageData"
- For images without transparency, automatically pick 1, L or RGB mode
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
1.eps
has aBoundingBox
of (72, 48), but itsImageData
says its size is (100, 67). Pillow currently believes the image size should be (100, 67), so I've added a BMP version of this image at that size to compare it to. However, this comparison does not currently work, because an error occurs when callingImage.tobytes()
on the EPS image.ValueError: No packer found from RGB to 1