Image.replace() blacks image

Hello,

I am trying to rotate an image read from an ImageIO stream by 270° (perform hmirror and transpose).
I read from the docs that image.replace is used for this.

So I tried this:

import image
import time

stream = image.ImageIO("video5.bin", "r")

clock = time.clock()
while True:
    clock.tick()
    img = stream.read(copy_to_fb=True, loop=True, pause=True)
    img.replace(hmirror=True, transpose=True)
    print(clock.fps())

which throws this error:
TypeError: ‘image’ argument required

Then tried this:

import image
import time

stream = image.ImageIO("video5.bin", "r")

clock = time.clock()
while True:
    clock.tick()
    img = stream.read(copy_to_fb=True, loop=True, pause=True)
    img.replace(True, False, True)
    print(clock.fps())

This does not throw an error, but the image I receive is black.

Best regards

That’s the old API.

We don’t have a great name for a function to do this. But:

img.scale(hint=image.TRANSPOSE|image.HMIRROR)

The unary stuff is all the .to_x functions along with scale/crop/copy.

replace()/set()/assign() are all just draw_image() calls now. They are binary operators. So, they need an input image.