{"id":20532491,"url":"https://github.com/joshdk/quantize","last_synced_at":"2025-04-14T06:31:24.099Z","repository":{"id":57513489,"uuid":"110171362","full_name":"joshdk/quantize","owner":"joshdk","description":"🎨 Simple color palette quantization using MMCQ","archived":false,"fork":false,"pushed_at":"2017-11-10T22:17:52.000Z","size":396,"stargazers_count":34,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T20:12:29.335Z","etag":null,"topics":["color-palette","color-scheme","golang","mmcq","quantization"],"latest_commit_sha":null,"homepage":"","language":"Go","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/joshdk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-09T22:04:21.000Z","updated_at":"2024-07-06T07:29:07.000Z","dependencies_parsed_at":"2022-08-31T22:01:42.815Z","dependency_job_id":null,"html_url":"https://github.com/joshdk/quantize","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Fquantize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Fquantize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Fquantize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdk%2Fquantize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshdk","download_url":"https://codeload.github.com/joshdk/quantize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248833163,"owners_count":21168809,"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":["color-palette","color-scheme","golang","mmcq","quantization"],"created_at":"2024-11-16T00:15:15.948Z","updated_at":"2025-04-14T06:31:24.036Z","avatar_url":"https://github.com/joshdk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/joshdk/quantize.svg)](https://opensource.org/licenses/MIT)\n[![GoDoc](https://godoc.org/github.com/joshdk/quantize?status.svg)](https://godoc.org/github.com/joshdk/quantize)\n[![Go Report Card](https://goreportcard.com/badge/github.com/joshdk/quantize)](https://goreportcard.com/report/github.com/joshdk/quantize)\n[![CircleCI](https://circleci.com/gh/joshdk/quantize.svg?\u0026style=shield)](https://circleci.com/gh/joshdk/quantize/tree/master)\n[![CodeCov](https://codecov.io/gh/joshdk/quantize/branch/master/graph/badge.svg)](https://codecov.io/gh/joshdk/quantize)\n\n# Quantize\n\n🎨 Simple color palette quantization using MMCQ\n\n## Installing\n\nYou can fetch this library by running the following\n\n    go get -u github.com/joshdk/quantize\n\n## Usage\n\n```go\nimport (\n\t\"image/color\"\n\t\"image/jpeg\"\n\t\"net/http\"\n\t\"github.com/joshdk/preview\"\n\t\"github.com/joshdk/quantize\"\n)\n\n// Fetch the source image\nresp, err := http.Get(\"https://blog.golang.org/gopher/plush.jpg\")\nif err != nil {\n\tpanic(err.Error())\n}\n\n// Decode jpeg contents\nimg, err := jpeg.Decode(resp.Body)\nif err != nil {\n\tpanic(err.Error())\n}\n\n// Reduce image into a palette of 8 colors\ncolors := quantize.Image(img, 3)\n\npalette := make([]color.Color, len(colors))\nfor index, clr := range colors {\n\tpalette[index] = clr\n}\n\n// Display our new palette\npreview.Show(palette)\n```\n\nAs an example, we can reduce a photo of the Go Gopher ([source](https://blog.golang.org/gopher)) into a color palette.\n\n![gopher](https://user-images.githubusercontent.com/307183/32680695-b853367a-c620-11e7-8b43-547a413ec9fd.png)\n\n## License\n\nThis library is distributed under the [MIT License](https://opensource.org/licenses/MIT), see LICENSE.txt for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdk%2Fquantize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdk%2Fquantize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdk%2Fquantize/lists"}