Wechat bot

Autorun robot compresses images by Mini Batch K-Means

Posted by ShuaiGao on January 15, 2019

Autorun robot compresses images by Mini Batch K-Means

Look at the code here

Using itchat package connect to wechat and recieve picture from friends, by using Mini Batch K-Means alorithm to replace the colors that picture contained with the color in the same cluster. The number of colors left can be easily defined. With a suitable color left number, the converted picture size has been significantly reduced without distortion.

IMG_0488.jpg The right hand side only contains 5 colors.

Except reduce the size of picture, it can also be used to produce something interesting. IMG_0487.jpg