Open orena1 opened 1 year ago
ipycanvas tries to stay close to the web canvas API, and this is not a feature that this API provides: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/putImageData
Though you can actually work around this by having another Canvas:
from ipycanvas import Canvas
import numpy as np
canvas1 = Canvas(width=200, height=200)
canvas1.put_image_data(np.random.uniform(size=(200,200,3)))
canvas2 = Canvas(width=300, height=300)
# Draw canvas1 on canvas2 and scale it down to (100, 100)
canvas2.draw_image(canvas1, 0, 0, 100, 100)
canvas2
Hi, As far as I can see, there is no way to scale an image when using
put_image_data
. e.g.:No matter the width and height of the canvas... Which is different from
draw_image
where there are two other variables(width, height)
which scale the image, is it possible to add this feature?