Copy part of one canvas to another canvas #271
Unanswered
WhatIThinkAbout
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Thanks! This looks like an issue with the latest ipycanvas release. You might fix it by downgrading ipycanvas to 0.11 for now. I just opened an issue for that https://github.com/martinRenou/ipycanvas/issues/272 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to copy part of a large canvas onto a smaller canvas. I had been doing this by retrieving the image data from the first canvas, at the required location, using "get_image_data" and then writing it to the smaller canvas with "put_image_data", as shown below:
This was working, but now seems to be broken and I'm now getting an error "cannot write mode RGBA as JPEG".
The image loaded onto the first canvas is a PNG, so does have a transparency channel and I can put the image data onto the new canvas if I drop this channel (image_data[:,:,:3]) - but I'd like to keep the transparency.
So, is there another way that I can copy a section from a large canvas to a smaller one, or put image data while retaining the transparency?
Beta Was this translation helpful? Give feedback.
All reactions