1

I'm trying to add text onto a photo using JES' addText function, but I'm not able to add my variable 'pixelsChanged' to the text. How can I do this? Each time I try I am told:

"The error value is: cannot concatenate 'str' and 'int' objects Inappropriate argument type. An attempt was made to call a function with a parameter of an invalid type. This means that you did something such as trying to pass a string to a method that is expecting an integer.:

Here's a sample of my code:

def changeColours(pic, startX, startY, endX, endY, endColour): 
  spotColour = makeColor(black)
  pixelsChanged = 0
  for px in getPixels(pic):
    x = getX(px)
    y = getY(px)
    if (startX <= x <= endX) and (startY <= y <= endY):
      if (distance(spotColour, getColor(px)) < 105):
        setColor(px,endColour)
        pixelsChanged = pixelsChanged + 1
  addText(pic, endX-35, endY,"Changed" + pixelsChanged, endColour)

Any help is appreciated

0 Answers0