Image class is just array of palette indices converted from the rgb data of any image by using euclidian distance between palette rgb and pixel rgb. Works well.