Updated EPS mode when opening images without transparency#8281
Updated EPS mode when opening images without transparency#8281hugovk merged 14 commits intopython-pillow:mainfrom
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>
radarhere
left a comment
There was a problem hiding this comment.
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.epshas aBoundingBoxof (72, 48), but itsImageDatasays 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