I have this python script, I now open an image from a given path in the script itself, what I need is a dynamical way to pass the image to the script.
For example: python pixel.py 9tiff
, I will be running this from php with shell exec and I will need to pass different images each time, so I can't hard code the image name in to a script itself
import os, sys
import Image
im = Image.open('/www/test/tiffFiles/9.tiff')
rgb_im = im.convert('RGB')
r0, g0, b0 = rgb_im.getpixel((20, 20))
r1, g1, b1 = rgb_im.getpixel((40, 40))
r2, g2, b2 = rgb_im.getpixel((60, 60))
print(r0, g0, b0)
print(r1, g1, b1)
print(r2, g2, b2)