Skip to content
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

Emf file is not handled correctly #8271

Open
muxkin opened this issue Jul 31, 2024 · 2 comments
Open

Emf file is not handled correctly #8271

muxkin opened this issue Jul 31, 2024 · 2 comments

Comments

@muxkin
Copy link

muxkin commented Jul 31, 2024

What's problem

When I tried to open an emf file and convert it to a jpg file using Pillow, I found that Pillow did not handle the colors in the image correctly. Where it should be white (#FFFFFF), Pillow thought it was (#F8F8F8). I am sure that place is white because this emf image is made by me, and when I open this image with other image viewing software, there is white.

Environment

Windows 10
Python == 3.11.5
pillow == 10.4.0

How to reproduce this situation

Copy figure below into PowerPoint and then save the figure as fig.emf. Use code below and then you can find that the area that should be #FFFFFF has become #F8F8F8.

from PIL import Image
emf_path="fig.emf" 
emf=Image.open(emf_path)
emf.show()

fig

@radarhere
Copy link
Member

Copy figure below into PowerPoint and then save the figure as fig.emf

Could you kindly just attach the EMF file itself? If GitHub won't let you attach the file, compress it into a ZIP first.

@muxkin
Copy link
Author

muxkin commented Aug 1, 2024

Sure. I have uploaded a ZIP file.
PillowIssue8271.zip

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

No branches or pull requests

2 participants