{"id":15692295,"url":"https://github.com/cbrgm/go-dither","last_synced_at":"2025-10-14T13:32:22.185Z","repository":{"id":115936855,"uuid":"588635642","full_name":"cbrgm/go-dither","owner":"cbrgm","description":null,"archived":true,"fork":false,"pushed_at":"2023-10-13T11:45:16.000Z","size":176,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T18:53:53.833Z","etag":null,"topics":["dither","dithering","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbrgm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-13T15:57:54.000Z","updated_at":"2023-12-11T16:38:58.000Z","dependencies_parsed_at":"2024-10-03T18:31:11.601Z","dependency_job_id":null,"html_url":"https://github.com/cbrgm/go-dither","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cbrgm/go-dither","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fgo-dither","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fgo-dither/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fgo-dither/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fgo-dither/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbrgm","download_url":"https://codeload.github.com/cbrgm/go-dither/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbrgm%2Fgo-dither/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018715,"owners_count":26086609,"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-14T02:00:06.444Z","response_time":60,"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":["dither","dithering","go"],"created_at":"2024-10-03T18:31:03.886Z","updated_at":"2025-10-14T13:32:18.819Z","avatar_url":"https://github.com/cbrgm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dithering\n\n**This is a command line tool for converting images to black and white using dithering techniques.**\n\n\u003e Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and video data, and is often one of the last stages of mastering audio to a CD. A common use of dither is converting a grayscale image to black and white, such that the density of black dots in the new image approximates the average gray level in the original.\n\nSee [Wikipedia](https://en.wikipedia.org/wiki/Dither)\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"examples/in_01.jpg\" width=\"200\" /\u003e\u003cbr\u003e\n  \u003cimg src=\"examples/output_o4.jpg\" width=\"200\" /\u003e\n  \u003cimg src=\"examples/output_o9.jpg\" width=\"200\" /\u003e\u003cbr\u003e\n  \u003cimg src=\"examples/output_r.jpg\" width=\"200\" /\u003e\n  \u003cimg src=\"examples/output_t.jpg\" width=\"200\" /\u003e\n\u003c/p\u003e\n\n## Usage\n\n```\ngo run main.go [image file] -m [dithering method] -f [output format] -o [output name] -q [output quality] -t [threshold value]\n```\n\nThe following dithering methods are supported:\n\n- \"o4\": Ordered 4x4 dithering\n- \"o9\": Ordered 9x9 dithering\n- \"t\": Threshold dithering\n- \"r\": Random dithering\n- \"a\": Apply all dithering methods and save the output with different names\n\nThe following output formats are supported:\n\n- \"jpg\"\n- \"png\"\n\nThe output quality parameter should be an integer between 1 and 100.\n\nThe threshold value is only used for threshold dithering.\n\nIf no arguments are provided, the program will use default values:\n\n- Dithering method: \"o4\"\n- Output format: \"jpg\"\n- Output name: \"output\"\n- Output quality: 100\n- Threshold value: 0\n\nThe tool checks if the provided image file exists, and exits with an error message if it does not.\n\n## Example Usage\n\n```bash\ngo run main.go image.jpg -m o9 -f png -o image_o9 -q 75 -t 128\n```\n\nThis will take the image \"image.jpg\", apply ordered 9x9 dithering, and save the output as a PNG image named \"image_o9\" with quality `75` and threshold `128`.\n\n## Acknowledgements\n\nThis CLI tool is heavily inspired by [sloum/lid](https://tildegit.org/sloum/lid)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrgm%2Fgo-dither","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbrgm%2Fgo-dither","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbrgm%2Fgo-dither/lists"}