use customized blur function

replace each pixel value with the average value of
the 8 adjacent pixels
use copied image
discretize colorspace