Here is an example of memoize. I've also used the builtin min
def nearest(pixel_color, mem={}):
if pixel_color in mem:
return mem[pixel_color]
n = min(floss_palette, key=lambda fc:delta_e_cie2000(pixel_color, fc))
mem[pixel_color] = n
return mem[pixel_color]
result = [nearest(pixel_color) for pixel_color in image]