This algorithm increases the brightness of each pixel until it finds an unused color. If that alters the color too much, it picks a random one out of what's left of the 16777216 colors.
This is a relatively quick run, but I'll probably try changing the parameters so it runs for a day or so.