#pixel

1 messages · Page 1 of 1 (latest)

solemn kayak
#

Can someone show me the simplest way to draw 100 pixels at random positions and random colors using Bevy ?
(I really raelly like to use PIL.Image with Python to just touch each pixel individually and want to try Rust for the performance boost)

midnight harness
#

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

eternal hornet