#pixel
1 messages · Page 1 of 1 (latest)
Bevy is probably overkill for this, but if you insist on using it you could try https://lib.rs/crates/bevy_image_export
Most likely you'd just want to use some basic image processing library. https://python-pillow.org/pillow-perf/ explores some pil-related performance benchmarks and could give you insight.
Many python libraries are actually written in c/c++ and have decent performance, so moving to rust is not a massive performance bump if you primarily use library functions
In your situation, I'd expect that the bottleneck could be randomness. Getting random data for each pixel may take some time on certain operating systems.
Depending on how you do it
I'd try to see if just storing the color values in a numpy array or something speeds it up any, if no it's not the image processing part that's slow but the number generation. In this case you could try to randomize the pixels with numpy, as I think it has a pretty well optimized function for generating random arrays of desired sizes
if you really want to do creating coding try out https://nannou.cc/. I haven't really tried it but this is better for putting pixels on the screen.