Improve memory consumption
Pre-release
Pre-release
The palette reduction step is taking up an inordinate amount of memory. With a few optimizations, the conversion of the test image went from 1.6 GB down to 0.5 GB.
Note that this still isn't efficient enough to handle large images.