Hello! One day I accidentally clicked with magic wand outside of the image (or and it made it go black and white (not grayscale). I liked result a lot, but I don’t know how to replicate it because there’s no B/W option, only grayscale. And I cant understand how magic wand decides what to show as black and what as white when using it. Does anybody have an idea how can I create the same effect by some tools or by hand?
(Image for demonstrating what I mean. I think that it probably connected to some color value but have no idea which one possibly…)
I’ve heard this effect described as ‘thresholding’, or as a ‘threshold filter’.
Krita has a threshold and an invert filter. Gimp does as well.
To do this within Aseprite, I’d create a Lua script after looking at the scripting API: https://aseprite.org/docs/scripting/. (Ideally, the effect would be written as a shader that works on pixels in parallel on the gpu, not by looping through each pixel one at a time on the cpu, as is done in Aseprite.)
If a pixel color’s value is less than a pivot, then it turns black. If it’s greater than or equal to the pivot, then it turns white. Judging by your picture, you’d want to invert the result, so that brighter colors are black and darker are white. For a range [0, 255], the pivot is typically 128, though you might want it to be adjustable.
Calculating a color’s value is a tradeoff between accuracy and speed. A weighted average is the most common method I’ve seen. The weights vary, and the accuracy of the result depends on the color profile. There’s also some other minor variation based on how a color’s data is stored in an image – as a byte in the range [0, 255], as a real number in [0.0, 1.0], etc.
value = (red * 30 + green * 59 + blue * 11) // 100