You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EPS files can have transparency, and GhostScript have the option to keep it. However, if we use Pillow to open an EPS-file, then the alpha-channel is discarded. To my understanding, this is because Pillow is currently using the ppm (portable pixel map)-driver, which creates RGB-images, not RGBA-images.
I therefore propose to add an option to specify which driver to use with GhostScript (or add a flag that can be enabled to use the pngalpha driver instead of the ppmraw driver)
To my understanding, this can be fixed by modifying line 120 in src/PIL/EpsImagePlugin.py:
EPS files can have transparency, and GhostScript have the option to keep it. However, if we use Pillow to open an EPS-file, then the alpha-channel is discarded. To my understanding, this is because Pillow is currently using the
ppm
(portable pixel map)-driver, which creates RGB-images, not RGBA-images.I therefore propose to add an option to specify which driver to use with GhostScript (or add a flag that can be enabled to use the
pngalpha
driver instead of theppmraw
driver)To my understanding, this can be fixed by modifying line 120 in
src/PIL/EpsImagePlugin.py
:Pillow/src/PIL/EpsImagePlugin.py
Line 120 in 20b8a83
into
I made the change locally on my machine, and it seemed to work well.
What are your OS, Python and Pillow versions?
Endnote: Script to generate a postscript file and convert it with Pillow
The text was updated successfully, but these errors were encountered: