def setup img = loadImage("fruit.png") image(img, 0, 0) for i in (0...img.height) do c = img.get(img.width / 2, i) stroke(c) line(0, i, width / 2, i) end end
[p5.js] (p5.Image.obj).height
イメージの高さが格納されているプロパティです。