{"id":15551400,"url":"https://github.com/imsahil007/kmeansimage","last_synced_at":"2026-05-15T01:33:09.847Z","repository":{"id":62574384,"uuid":"278552461","full_name":"imsahil007/KMeansImage","owner":"imsahil007","description":"Python package to compress images in python using KMeans-Clustering technique","archived":false,"fork":false,"pushed_at":"2020-08-17T04:31:04.000Z","size":16007,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T21:52:46.388Z","etag":null,"topics":["clusters","image-compression","jupyter-notebook","kmeans-clustering","pypi-package","python","python3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/KMeansImage/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imsahil007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-10T06:05:54.000Z","updated_at":"2023-03-08T00:57:27.000Z","dependencies_parsed_at":"2022-11-03T17:30:34.159Z","dependency_job_id":null,"html_url":"https://github.com/imsahil007/KMeansImage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imsahil007/KMeansImage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsahil007%2FKMeansImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsahil007%2FKMeansImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsahil007%2FKMeansImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsahil007%2FKMeansImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imsahil007","download_url":"https://codeload.github.com/imsahil007/KMeansImage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsahil007%2FKMeansImage/sbom","scorecard":{"id":486380,"data":{"date":"2025-08-11","repo":{"name":"github.com/imsahil007/KMeansImage","commit":"db47601e5128cd8e3b85769263cc6fb46ec91f99"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: dist/KMeansImage-1.0-py3-none-any.whl:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T17:55:42.083Z","repository_id":62574384,"created_at":"2025-08-19T17:55:42.083Z","updated_at":"2025-08-19T17:55:42.083Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013127,"owners_count":26085232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":["clusters","image-compression","jupyter-notebook","kmeans-clustering","pypi-package","python","python3"],"created_at":"2024-10-02T14:04:46.371Z","updated_at":"2025-10-12T21:52:47.169Z","avatar_url":"https://github.com/imsahil007.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KMeansImage\n# Pip package(Python \u003e= 3.0)\n\nThis is a python package to compress images in python using KMeans-Clustering technique.\n\n[![N|Solid](https://pypi.org/static/images/logo-small.6eef541e.svg)](https://pypi.org/project/KMeansImage/)\n\n![png](https://github.com/imsahil007/KMeansImage/blob/master/res/kmeans.png)\nDownload the package using:\n```\npip3 install KMeansImage\n```\n\n# How to use:\n```\nfrom KMeansImage import kmeans_image\nk_img = kmeans_image( $image_path_with_image_name ,  $output_colors )\nk_img.save( $save_path_with_file_name )\n```\nIn case you are using Jupyter notebook, you can also use:\n```\nfrom KMeansImage import kmeans_image_ui\nk_img = kmeans_image_ui( $image_directory_path )\nk_img.save( $save_path_with_file_name )\n```\n# Example: [Pdf](https://github.com/imsahil007/KMeansImage/blob/master/res/tutorial.pdf)\n\nImport Library\n\n\n```python\nfrom KMeansImage import kmeans_image\n```\n\nFirst parameter = path\u003cbr\u003e\nSecond parameter = No. of colors i.e. Clusters\n\n\n```python\nk_img = kmeans_image('/home/sahil/Downloads/KMeansImage/res/batman.jpg', 20)\n```\n\n    Original Image size: 419.291KB\n    Compressed Image: 253.235KB\n\n\n\n![png](https://github.com/imsahil007/KMeansImage/blob/master/res/batman_KMeans_.jpg)\n\n\nSee the difference between size of both pics\u003cbr\u003e\nFor saving the file use -\n\n\n```python\nk_img.save()\n```\n\n    Image saved: /home/sahil/Downloads/KMeansImage/res/batman_KMeans_.jpg\n\n\n# Interactive For Jupyter Notebook\n\n\n```python\nfrom KMeansImage import kmeans_image_ui\n```\n\nParameter = Image directory path\n\n\n```python\nk_img = kmeans_image_ui('/home/sahil/Downloads/KMeansImage/res/')\n```\n\n\n![png](https://github.com/imsahil007/KMeansImage/blob/master/res/example.png)\n\n\n\n```python\nk_img.save()\n```\n\n    Image saved: /home/sahil/Downloads/KMeansImage/res/sherlock_KMeans_.jpg\n\n# Jupyter Notebook Dependency:\n```\npip install ipywidgets\njupyter nbextension enable --py widgetsnbextension\njupyter labextension install @jupyter-widgets/jupyterlab-manager\n```\n\nYou can also download using Github:\n  - Download and extract this repo\n  - Move the terminal to the directory of setup.py\n  ```\n  pip install .\n  ```\n\n# Packages Required:\n- numpy\n- scikit-learn\n- matplotlib\n- ipywidgets\n\n\n\n\n\n#### Contact Me:\n\n[Sahil](https://github.com/imsahil007)\n\n\n### Todos\n\n - Add a button for saving images instead of save() in interactive notebook\n - Add some boundary conditions\n - Add Test cases\n\nLicense\n----\n\nMIT\n\n\n**Free Software, Hell Yeah!**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimsahil007%2Fkmeansimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimsahil007%2Fkmeansimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimsahil007%2Fkmeansimage/lists"}