How are images (roughly) clustered when using KNN
Lets say its a gray scale image. And of size 224*224 than you have 50176 possible pixel values. So you can plot on x axis widt=224 and on y heigth=224. 

Lets say they are coloured. Than you have more chanels=dimensions. In that case you perform clustering in higher dimensional space