def change(pic, startX, startY, getHeight, getWidth, endColour):
width = getWidth
height = getHeight
picture = makePicture(pic)
for px in getPixels(picture):
x = getX(px)
y = getY(px)
if (startX <= x <= getHeight) and (startY <= y <= getWidth):
if (distance(black, getColor(px)) < 95):
setColor(px, endColour)
show (picture)
return (picture)
Here is the code I have so far. What I need it to do is change the middle 1/3 of the black pixels in a photo to red, and the bottom 1/3 of the black pixels to yellow, as well as print on the photo how many black pixels where changed to yellow, and how many were changed to red. I am very new to JES and Jython and programming overall so help with this would be greatly appreciated!