Why compressed image size is greater than original one in kmeans algorithm?
Your are saving the same color format... if they are 24bits RGB you are currently saving also in 24 bits RGB. You should convert to RGB-8 that uses 8 bits per pixel.

I have used pypng and PIL to get the following result

from PIL import Image
import png

    s = []
    for i in range(rows):
        s.append(tuple(labels[i].astype(int)))

    palette = []
    for i in range(ncolor):
        c = (centers[i][0].astype(int), centers[i][1].astype(int), centers[i][2].astype(int))
        palette.append(c)

    w = png.Writer(width=cols, height=rows, palette=palette, bitdepth=8)
    f = open('tiger8bits3.png', 'wb')
    w.write(f, s)


Look at PNG formats: http://www.patrickhansen.com/2011/02/04/png-8-24-32-what/

The result is 269KB: