です。
from PIL import Image
#
print "\nStarting script"
#
# Load the image
im = Image.open('Pixels_Test_Image.png')
px = im.load()
#
# Determine the image size
width, height = im.size
print "width, height = " + str(width) + ", " + str(height)
#
# Loop over each pixel and test rgb values to find black pixels
non_white_i_pixel = []
non_white_j_pixel = []
i_pixel = 0
set_limit = 100
while i_pixel < width:
j_pixel = 0
while j_pixel < height:
r, g, b, xx = (px[i_pixel, j_pixel])
#print i_pixel, j_pixel, a, b, c, d
if(r < set_limit and g < set_limit and b < set_limit):
non_white_i_pixel.append(i_pixel)
non_white_j_pixel.append(j_pixel)
j_pixel += 1
i_pixel += 1
#
print "len(non_white_i_pixel) = " + str(len(non_white_i_pixel))
print "len(non_white_j_pixel) = " + str(len(non_white_j_pixel))
print non_white_i_pixel
print non_white_j_pixel
#
print "\nFinished script"
numpyライブラリを使用できますか? – ZdaR
"xとy成分を記述する2つの配列"という意味は、私には少し不明です。すべての黒のピクセルの座標?しかし、灰色のピクセルは何ですか?私があなたを正しく理解していれば、絵を描くのに使われた実際のパスを表現したいのですか?たとえば、inkscapeを使用してビットマップをベクトル化しようとする必要があります。 – Fritz
あなたは確かにpythonでそれを枕とnumpyで行うことができます。 – Jannick