07-12-2023, 07:01 AM
The Color erase mode computes the most transparent pixel under which you can stack the erased color to rebuild the initial color. For instance, yif you Color-erase a purple pixel with red, you are left with a partially transparent blue, and if you put this pixel over the erase red, you get the purple back.
In your case the result of the posterization is used as a temporary/virtual color-erase layer. If you had an infinite level of posterization, the posterized image would be identical to the source image, and all pixels would be color-erased by a copy of themselves and would turn fully transparent. With normal posterization levels, you color-erase pixels with whatever color the posterization would color them into, which is fairly random because that depends on the rest f the image and the posterization levels.... The only not-too-random part of the result is that since the pixel is replaced by the closest color in the posterization set it will be likely quite transparent. But since you throw away the alpha channel all you see is the residual color, which v very transparent pixels is not that accurate so you have a bit of randomness here too, especially in 8bpc mode.
IMHO you would get very similar results, by 1) color-indexing the image, and 2) assigning random values in the color map.