Search code examples
pythonpython-imaging-library

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'"


Solution

  • 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")