thanks to naila.murray@gmail.com
#!/usr/bin/env python
# naila.murray@gmail.com
from PIL import Image
import sys
if len(sys.argv) < 2:
import os
print 'usage: %s input_img output_img' % os.path.basename(sys.argv[0])
quit()
# open image:
imgname = sys.argv[1]
img = Image.open(imgname)
# create RGB image:
if img.mode == "L":
print "image is grayscale"
img_rgb = Image.merge("RGB",(img,img,img))
img_rgb.save(sys.argv[2])
elif img.mode == "RGB":
print "image is RGB"
No comments:
Post a Comment