Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Test 1.eps size and data

Open Yay295 opened this issue 1 year ago • 4 comments

  1. I moved all EPS images (and images converted from EPS images) to their own folder so that they're all together.
  2. I noticed that 1.eps has a BoundingBox of (72, 48), but its ImageData 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 calling Image.tobytes() on the EPS image.

ValueError: No packer found from RGB to 1

Yay295 avatar Aug 03 '24 18:08 Yay295

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.

Yay295 avatar Aug 03 '24 20:08 Yay295

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.

Yay295 avatar Aug 03 '24 23:08 Yay295

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.

This is reverting the change requested in https://github.com/python-pillow/Pillow/issues/6382#issuecomment-1213597912. I'm reluctant to change how Pillow behaves again just because a different third-party application was chosen to compare this against?

radarhere avatar Aug 04 '24 04:08 radarhere

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.

Yay295 avatar Aug 04 '24 05:08 Yay295