Thanks Hapax and Mario,
About the Hapax's first and second method:
Well, shapes can be quite different are 100% unpredictable as the effect shall cope with sprites added by the user. Canvas size is known, though.
How would your methods work if there is an uneven amount of coloured pixels?
Mario, sadly default sprites are quite huge already - the effect happens to multiple objects at once, too.
I'm not even sure, if there is a cheap method for this. Maybe working in rough chunks instead of pixel-by-pixel.