I am looking for the best performing code, which removes all black pixels = #{000000} from a binary. Code Example:
img: make image! [100x75 0.0.255]
loop 1000 [change at img random 99x74 0.0.0]
probe length? foo: copy img/rgb
probe delta-time [remove-each [r g b] foo [ all [zero? r zero? g zero? b] ]]
probe length? foo
foo: copy img/rgb
probe delta-time [trim/with foo #{000000}]
probe length? probe foo
Trim performs quite fast but doesn't work as supposed, as it removes all zero-byte #{00} from the binary.
What is the fastest code to remove all "black pixels" = three zero-bytes = #{000000} from a binary? Any further suggestions? Might be using parse performs better?