pxtobrx
pxtobrx copied to clipboard
refactor the algorithm
the algorithm was built in an exploratory way, so the end result is less than ideal.
- all colors should be in hex, as that is what color-difference operates on.
- should only calculate rects once per image, and possibly cache them
- assignColorAndGetPieces is just weird
- difficult to choose how the algorithm should optimize, currently it is hardcoded for price
- etc