April 2018
Intermediate to advanced
408 pages
10h 42m
English
The naive use of the product() function to compare all pixels and all colors was a bad idea. There are 10 million pixels, but only 2,00,000 unique colors. When mapping the source colors to target colors, we only have to save 2,00,000 values in a simple map.
We'll approach it as follows:
product(range(0,256,32), range(0,256,32), range(0,256,32))