1from PIL import Image
2
3img = Image.open('image.png')
4rgb_img = img.convert('RGB')
5rgb_img.save('image.jpg')
1from PIL import Image
2
3img=Image.open("File.eps") # Path to eps file
4fig=img.convert("RGBA")
5fig.save("File.png") # Path where new image is to be saved
6
7# If you get an OSError, check out this link:
8# https://www.tutorialexample.com/python-convert-eps-to-png-with-pillow-a-beginner-guide-python-tutorial/
9
10# If you get a FileNotFoundError associating "gs":
11# https://stackoverflow.com/questions/34564145/python-no-such-file-or-directory-gs-error-even-with-ghostscript-installed-o