{"id":13526757,"url":"https://github.com/esimov/dithergo","last_synced_at":"2025-08-21T09:32:59.470Z","repository":{"id":47647182,"uuid":"80107339","full_name":"esimov/dithergo","owner":"esimov","description":"Various dithering algorithms implemented in Go","archived":false,"fork":false,"pushed_at":"2021-02-15T14:56:55.000Z","size":21584,"stargazers_count":169,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T08:12:43.396Z","etag":null,"topics":["dithering-algorithms","floyd-steinberg","go","image-processing"],"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/esimov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"esimov"}},"created_at":"2017-01-26T11:00:15.000Z","updated_at":"2025-03-23T23:45:16.000Z","dependencies_parsed_at":"2022-07-22T11:03:13.899Z","dependency_job_id":null,"html_url":"https://github.com/esimov/dithergo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/esimov/dithergo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fdithergo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fdithergo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fdithergo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fdithergo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esimov","download_url":"https://codeload.github.com/esimov/dithergo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fdithergo/sbom","scorecard":{"id":382560,"data":{"date":"2025-08-11","repo":{"name":"github.com/esimov/dithergo","commit":"7f9ddf55e84884b02360fd2ddad64753992e71bb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/esimov/dithergo/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/esimov/dithergo/build.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"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":"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":"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":"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":"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":"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"}},{"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"}}]},"last_synced_at":"2025-08-18T15:49:05.955Z","repository_id":47647182,"created_at":"2025-08-18T15:49:05.955Z","updated_at":"2025-08-18T15:49:05.955Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271455678,"owners_count":24762772,"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-08-21T02:00:08.990Z","response_time":74,"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":["dithering-algorithms","floyd-steinberg","go","image-processing"],"created_at":"2024-08-01T06:01:34.275Z","updated_at":"2025-08-21T09:32:59.048Z","avatar_url":"https://github.com/esimov.png","language":"Go","funding_links":["https://github.com/sponsors/esimov"],"categories":["Go"],"sub_categories":[],"readme":"# dithergo\n[![CI](https://github.com/esimov/dithergo/workflows/CI/badge.svg)](https://github.com/esimov/dithergo/actions)\n[![Go Reference](https://pkg.go.dev/badge/github.com/esimov/dithergo.svg)](https://pkg.go.dev/github.com/esimov/dithergo)\n[![license](https://img.shields.io/github/license/esimov/dithergo)](./LICENSE)\n\n\u003cstrong\u003eDithergo\u003c/strong\u003e is a simple Go library implementing various [dithering](https://en.wikipedia.org/wiki/Dither) algorithm to produce halftone images. It supports color and monochrome image outputs.\n\nThe library implements the following dithering methods: ***Floyd Steinberg, Atkinson, Burkes, Stucki, Sierra-2, Sierra-3, Sierra-Lite***. All of these algorithms have something in common: they diffuse the error in two dimensions, but they always push the error forward, never backward.\n\nWe can represent this with the following diagram:\n\n             X   7   5 \n     3   5   7   5   3\n     1   3   5   3   1\n\n           (1/48)\n\nwhere `X` represent the current pixel processed. The fraction at the bottom represents the divisor for the error. Above is the  the `Floyd-Steinberg` dithering algorithm which can be transposed into the following Go code:\n\n```go\nditherers = []dither.Dither{\n\tdither.Dither{\n\t\t\"FloydSteinberg\",\n\t\tdither.Settings{\n\t\t\t[][]float32{\n\t\t\t\t[]float32{ 0.0, 0.0, 0.0, 7.0 / 48.0, 5.0 / 48.0 },\n\t\t\t\t[]float32{ 3.0 / 48.0, 5.0 / 48.0, 7.0 / 48.0, 5.0 / 48.0, 3.0 / 48.0 },\n\t\t\t\t[]float32{ 1.0 / 48.0, 3.0 / 48.0, 5.0 / 48.0, 3.0 / 48.0, 1.0 / 48.0 },\n\t\t\t},\n\t\t\tfloat32(multiplier),\n\t\t},\n\t},\n}\n```\n\nYou can plug in any dithering algorithm, so the library can be further extended.\n\n### Installation\n\n`$ go get -u -v github.com/esimov/dithergo`\n\n### Running\n\nType `go run cmd/main.go --help` to check all the supported commands. The library supports the following commands:\n\n```\nUsage of commands:\n  -e string\n    \tGenerates \u0026 exports the color and greyscale mode halftone images. \n\tOptions: 'all', 'color', 'mono' (default \"all\")\n  -em float\n    \tError multiplier (default 1.18)\n  -o string\n    \tOutput folder\n  -t\tOption to export the tresholded image (default true)\n\n```\nYou can run all of the supported dithering algorithms at once, or you can run a specific one from the `cmd` directory.  \n\n### Results:\n|  Input  |\n|:--:|\n|\u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/input/david.jpg\" height=\"250\"\u003e|\n\nThe below images are generated with the default options using Michelangelo's David statue as sample image.\n\n|  Color  | Monochrome   |\n|:--:|:--:|\n|\u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/color/Atkinson.png\" height=\"250\"\u003e | \u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/mono/Atkinson.png\" height=\"250\"\u003e |\nAtkinson | Atkinson |\n|\u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/color/Burkes.png\" height=\"250\"\u003e | \u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/mono/Burkes.png\" height=\"250\"\u003e |\nBurkes | Burkes |\n|\u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/color/FloydSteinberg.png\" height=\"250\"\u003e | \u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/mono/FloydSteinberg.png\" height=\"250\"\u003e |\nFloyd-Steinberg | Floyd-Steinberg | \n|\u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/color/Sierra-2.png\" height=\"250\"\u003e | \u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/mono/Sierra-2.png\" height=\"250\"\u003e | \nSierra-2 | Sierra-2 | \n|\u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/color/Sierra-3.png\" height=\"250\"\u003e | \u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/mono/Sierra-3.png\" height=\"250\"\u003e |\nSierra-3 | Sierra-3 | \n|\u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/color/Sierra-Lite.png\" height=\"250\"\u003e | \u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/mono/Sierra-Lite.png\" height=\"250\"\u003e |\nSierra-Lite | Sierra-Lite | \n|\u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/color/Stucki.png\" height=\"250\"\u003e | \u003cimg src=\"https://raw.githubusercontent.com/esimov/dithergo/master/output/mono/Stucki.png\" height=\"250\"\u003e |\nStucki | Stucki | \n\n## Author\n\n* Endre Simo ([@simo_endre](https://twitter.com/simo_endre))\n\n## License\n\nCopyright © 2018 Endre Simo\n\nThis software is distributed under the MIT license found in the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesimov%2Fdithergo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesimov%2Fdithergo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesimov%2Fdithergo/lists"}