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
convert: process pixels as u32; avoid writing back transparent pixels
Treat a pixel as u32 rather than 4 * u8. In the opaque case this reduces
to a shift, bswap, and OR.
In the transparent case, we don't need to write back at all, so don't.
On my machine, a lowlevel._read_region() microbenchmark produces these
speedups:
- Opaque pixels: 1.55x
- Transparent pixels: 2.07x
- Random pixels (nontrivial alpha): 1.27x
0 commit comments