{"id":24901938,"url":"https://github.com/lancegin/haishoku","last_synced_at":"2025-04-05T13:09:27.235Z","repository":{"id":40669037,"uuid":"91250667","full_name":"LanceGin/haishoku","owner":"LanceGin","description":"A development tool for grabbing the dominant color or representative color palette from an image","archived":false,"fork":false,"pushed_at":"2020-09-23T06:29:25.000Z","size":945,"stargazers_count":285,"open_issues_count":5,"forks_count":27,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-29T12:11:10.416Z","etag":null,"topics":["design-tools","dominant-colors","palette","pillow","python3"],"latest_commit_sha":null,"homepage":"","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/LanceGin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-14T14:56:08.000Z","updated_at":"2025-01-01T05:18:34.000Z","dependencies_parsed_at":"2022-08-25T07:41:47.879Z","dependency_job_id":null,"html_url":"https://github.com/LanceGin/haishoku","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanceGin%2Fhaishoku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanceGin%2Fhaishoku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanceGin%2Fhaishoku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanceGin%2Fhaishoku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LanceGin","download_url":"https://codeload.github.com/LanceGin/haishoku/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"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","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":["design-tools","dominant-colors","palette","pillow","python3"],"created_at":"2025-02-01T21:18:48.276Z","updated_at":"2025-04-05T13:09:27.212Z","avatar_url":"https://github.com/LanceGin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Haishoku\n\n\u003e `haishoku` is a JP word, it means palette in English.\n\nHaishoku is a development tool for grabbing the dominant color or representative color palette from an image, it depends on `Python3` and `Pillow`.\n\n### Feature\n\n1. Grab the `dominant color` from a image.\n\n2. Grab the representative `color palette` from a image.\n\n3. From `v1.1.4`, Haishoku could load a image from remote url. \n\n### Demo\n![demo](http://orhcxc3kd.bkt.clouddn.com/haishoku.png)\n\n( original image's source: dribbble )\n\n### Installation\n\n```shell\npip3 install haishoku\n```\n\nor maybe you should use\n\n```shell\npython3 -m pip install haishoku\n```\n\n### Api\n\n#### • loadHaishoku( image )\n\n```python\nfrom haishoku.haishoku import Haishoku\nhaishoku = Haishoku.loadHaishoku(image)\n```\n\nit will return a Haishoku instance, and you can use `haishoku.dominant` and `haishoku.palette` to get the image's dominant color and color palette\n\n\u003e Also, you can use more immediately api to get them or show them temporarily, just like below:\n\n#### • getDominant( image )\n\n```python\nfrom haishoku.haishoku import Haishoku\ndominant = Haishoku.getDominant(image)\n```\n\nreturns: (R, G, B) `tuple`\n\n#### • showDominant( image )\n\n```python\nfrom haishoku.haishoku import Haishoku\nHaishoku.showDominant( image )\n```\n\nit will open a temporary image to show the dominant color.\n\n#### • getPalette( image )\n\n```python\nfrom haishoku.haishoku import Haishoku\npalette = Haishoku.getPalette( image )\n```\n\nreturns: [(percentage, (R, G, B)), (percentage, (R, G, B)), ...] `Array` length \u003c= 8\n\n#### • showPalette( image )\n\n```python\nfrom haishoku.haishoku import Haishoku\nHaishoku.showPalette( image )\n```\n\nit will open a temporary image to show the palette.\n\n### 中文文档\n\n [中文文档](docs/document_zh.md)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancegin%2Fhaishoku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flancegin%2Fhaishoku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancegin%2Fhaishoku/lists"}