image Object should have imagePixelColor method

  • admin

    The imagePixelColor() function requires a path in order to get a pixel color. Sometimes we already have an image object open. It would be convenient to be able to quiz it for its pixel colors without having to open the file each time.

  • admin

    drawBot caches the path as image object inside, the cache is cleared when the context is done drawing

  • You can pass an ImageObject to imagePixelColor():

    im = ImageObject()
    with im:
        fill(1, 0, 0)
        rect(100, 100, 200, 200)
    print(imagePixelColor(im, (150, 140)))