Most of the program currently uses lists and tends to check list members with
in, which is much more efficient with sets. Also two functions manipulate a set of black pixels, with subset and set difference operations, implemented from lists.
This pull requests replaces many list structures with sets, and normalizes lines by sorting the tuples. This significantly improves performance, with speedups ranging from 10x to 50x, and removes the need for duplicate removal.
See Utiliser le Sprite Optimizer (#165850) for more details.