You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: I have a color image Array2<RGBA8>, and want to visualize it using rust-numpy lib (a binding to python numpy). However, .to_pyarray() complains, so I should convert it into Array3<u8>.
Question: How can I do that - what is the correct/fast way to do so? IMHO the fastest way should even have no memory copy at all, since RGBA8 is compact 4-byte data. But one memory copy is also acceptable.
I have come up with a very slow method but I hope there are other ways: extract Array2<RGBA8> into four Array<u8> for each of 4 channels, and stack! them together. Its performance seems to be quite slow.