Does anyone know of any way to convert a ppm file to a jpeg/jpg using python 3.4.1 specifically? I've looked around and can only find solutions for previous version of python.
You can use the Pillow
module. The following should work:
from PIL import Image
im = Image.open("sweet_pic.ppm")
im.save("sweet_pic.jpg")
Read through the tutorial for more information.
You can use OpenCV
i = cv.imread('im0001.ppm')
cv.imwrite('im0001.jpg',i)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With