from PIL import Image
import sys
from struct import *
import array
if len(sys.argv) != 4:
print "***** Usage syntax Error!!!! *****\n"
print "Usage:"
print "python
sys.exit(1) # exit
else:
pass
image_name = sys.argv[1]
width = int(sys.argv[2])
height = int(sys.argv[3])
y = array.array('B')
u = array.array('B')
v = array.array('B')
f_y = open(image_name, "rb")
f_uv = open(image_name, "rb")
f_uv.seek(width*height, 1)
image_out = Image.new("RGB", (width, height))
pix = image_out.load()
print "width=", width, "height=", height
for i in range(0, height/2):
for j in range(0, width/2):
u.append(ord(f_uv