I am trying to convert an image from PNG to EPS using Pillow. The following code gives an error:
from PIL import Image
Image.open("Image1.png").save("Image1.eps", fmt='EPS')
Which reads:
Traceback (most recent call last):
File "C:/Users/pbreach/Dropbox/Personal/FigureConversion/convert.py", line 15, in <module>
convert_image(in_name, out_name, fmt='EPS')
File "C:/Users/pbreach/Dropbox/Personal/FigureConversion/convert.py", line 4, in convert_image
Image.open(in_name).save(out_name, fmt)
File "C:\Users\pbreach\Continuum\Anaconda3\lib\site-packages\PIL\Image.py", line 1826, in save
save_handler(self, fp, filename)
File "C:\Users\pbreach\Continuum\Anaconda3\lib\site-packages\PIL\EpsImagePlugin.py", line 362, in _save
raise ValueError("image mode is not supported")
ValueError: image mode is not supported
Is EPS really not supported? In the documentation EPS is second on the list of fully supported formats. Is there anything that I need to do if this is not the case?
Weirdly enough, if I do Image.open("Image1.png").save("Image1.jpg", fmt='EPS') it works but saves to JPG.