简体   繁体   中英

how to convert eps to jpg or png using python script

from PIL import Image
img = Image.open('image.eps')
rgb_img = img.convert('RGB')
rgb_img.save('image.jpg')

I tried this code to convert my EPS image to JPG image, but I receive the error like this.

1. "OSError: Unable to locate Ghostscript on paths"

I executed this code in Google colab, I get the error like this.

2. "FileNotFoundError: [Errno 2] No such file or directory: 'gs'"

Here is my code to convert eps image to jpg or png (images)

from PIL import Image
eps_image = Image.open("eps_image_path")
eps_image.load(scale=10)
eps_image.save("save_path_image")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM