@lovell Oh interesting! I guess the threshold maps in particular could benefit from native implementations as the operation is parallelisable. And I guess would be easy to support as a generic operation perhaps? It’s a similar operation to how `.convolve()` or `.recomb()` take a matrix. Could even be an extension of `.threshold()` where instead of providing a single threshold value you can provide a matrix instead.
One awkward thing building this was that there’s no way to do something like `image.map()` for generic pixel manipulations, you always have to copy the image into a raw output buffer, operate on that, and then create a new image from it to format a proper output. I guess implementing genuinely custom operations that run on some shared view of the image data may not be possible though.
I haven’t actually benchmarked any of these operations yet. At some point I’d like to see what the processing overhead is.
Another thing a native implementation could benefit from maybe is better transparency handling. I’m working on that at the moment and finding it a bit tricky to detect if an image is really *using* its alpha channel (because if it isn’t, it’s safe to drop and output as a smaller 1-channel B/W image).