RosettaCodeData/Task/Bitmap-PPM-conversion-through-a-pipe/Python/bitmap-ppm-conversion-through-a-pipe.py

11 lines
333 B
Python
Raw Permalink Normal View History

2019-09-12 10:33:56 -07:00
"""
Adapted from https://stackoverflow.com/questions/26937143/ppm-to-jpeg-jpg-conversion-for-python-3-4-1
Requires pillow-5.3.0 with Python 3.7.1 32-bit on Windows.
Sample ppm graphics files from http://www.cs.cornell.edu/courses/cs664/2003fa/images/
"""
from PIL import Image
im = Image.open("boxes_1.ppm")
im.save("boxes_1.jpg")