Convert to 3-dimensional matrix of [y-value, x-value, rgb] using imread. Each entry is an integer between 0 and 255 representing the value of the color indicated by rgb at (x, y).
Reduce linear resolution 8 times by averaging the values in each 8x8 matrix block (for faster processing).
Run k-means (self-implemented) for 20 iterations with k = 2, obtaining 2 colors which are the centroids of each cluster.
For each pixel in the original image, replace its value with the closest color based on Euclidean norm of RGB.
Note: Please do not convert this to a JPEG. It must remain in a lossless format to preserve the integrity of the RGB values. Also do not delete this as a scaled-down duplicate of File:Polarlicht 2 kmeans 2 large.png; the manner in which it is a smaller version of that image is important to the purpose of the image.
Fecha
Fuente
Trabajo propio
Autor
Senior Airman Joshua Strang, derivative work by King of Hearts
Yo, el titular de los derechos de autor de esta obra, lo libero al dominio público. Esto aplica en todo el mundo. En algunos países esto puede no ser legalmente factible; si ello ocurriese: Concedo a cualquier persona el derecho de usar este trabajo para cualquier propósito, sin ningún tipo de condición al menos que éstas sean requeridas por la ley.
Public domainPublic domainfalsefalse
Esta imagen o archivo es obra de un aviador o empleado de la Fuerza Aérea de los Estados Unidos de América, hecho en el curso de las funciones oficiales de esa persona. Como un trabajo del gobierno federal de los Estados Unidos de América, la imagen o el archivo está en el dominio público.