{"id":51115299,"url":"https://github.com/preetmishra/image-compression-kmeans","last_synced_at":"2026-06-24T21:04:14.763Z","repository":{"id":48521509,"uuid":"195178294","full_name":"preetmishra/image-compression-kmeans","owner":"preetmishra","description":"Image compression using K-Means.","archived":false,"fork":false,"pushed_at":"2020-07-06T18:03:21.000Z","size":552,"stargazers_count":14,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-30T12:40:06.807Z","etag":null,"topics":["image-compression","kmeans","machine-learning","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/preetmishra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-04T06:02:24.000Z","updated_at":"2023-10-02T13:27:31.000Z","dependencies_parsed_at":"2022-08-12T19:50:39.252Z","dependency_job_id":null,"html_url":"https://github.com/preetmishra/image-compression-kmeans","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/preetmishra/image-compression-kmeans","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preetmishra%2Fimage-compression-kmeans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preetmishra%2Fimage-compression-kmeans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preetmishra%2Fimage-compression-kmeans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preetmishra%2Fimage-compression-kmeans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/preetmishra","download_url":"https://codeload.github.com/preetmishra/image-compression-kmeans/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/preetmishra%2Fimage-compression-kmeans/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34749297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-compression","kmeans","machine-learning","python"],"created_at":"2026-06-24T21:04:14.209Z","updated_at":"2026-06-24T21:04:14.754Z","avatar_url":"https://github.com/preetmishra.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Compression using K-Means algorithm.\n\nThe script uses K-Means, a Machine Learning clustering algorithm, to cluster all the colors in an image into 16 clusters and replace the RGB value of every pixel with the RGB value of their respective cluster center and thus reducing the amount of memory required to save a picture. \n\n\n### Comparison\n\n#### File sizes\n\n![ss](https://user-images.githubusercontent.com/43616959/60655227-055a3d00-9e6b-11e9-9b3c-341ccbf37f00.png)\n\n\n Original Image(dog.png)         |  Compressed Image(dog-compressed.png) \n-------------------------|-------------------------\n![Original Image](dog.png) | ![Compressed Image](dog-compressed.png)\n\n\n### Requirements\n- Python\n- Scipy\n- Numpy\n- Matplotlib\n\n### Instructions\n- Download script.py in your required directory.\n- Run python script.py _yourfilenamehere.png_ in your terminal.\n\n### Note\n\u003e Use a .png file as JPEG uses lossy compression which may lead to undesired result.\n\n## Author\n- **Preet Mishra** [LinkedIn](https://www.linkedin.com/in/preetmishra)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreetmishra%2Fimage-compression-kmeans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpreetmishra%2Fimage-compression-kmeans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpreetmishra%2Fimage-compression-kmeans/lists"}