Threshold adjustment layer emulation with blending modes.

This guide assumes Photoshop-like blending modes, which applies to many graphical editors. Tested with Aseprite and Photopea (which already has a Threshold adjustment layer but it's unreliable).

You need three layers:

The bottom layer can be skipped if your image is already grayscale.

Lock the top and bottom layers. The middle layer controls the actual threshold. If the value of a pixel of the background is higher than the value of the pixel of the middle layer, the resulting pixel will be white, and black otherwise.

1. Inverted

It's sometimes more intuitive to invert the threshold, where darker pixels of the middle layer mean the resulting image will generally have more black pixels. To do that, set the top layer to “Color Burn”, and the middle layer to “Linear Dodge” (sometimes called “Addition”).

2. Explanation

The bottom layer forces the image to grayscale. This makes sure every channel is the same, to end up with 1 bit per pixel instead of 1 bit per channel.

The middle layer subtracts a constant value from each pixel of the background. If the pixel of the background is darker than, or the same as, the pixel of the middle layer, the subtraction will yield 0, i.e. black. Otherwise, the subtraction will yield some value greater than 0.

Dividing in the context of blend modes has a quirk where 0÷0 = 0, and 𝑥÷0 = 1 for 𝑥 > 0. The top layer essentially sets all non-black pixels to white.