{"id":20812238,"url":"https://github.com/curegit/halftone-converter","last_synced_at":"2025-05-07T10:34:21.755Z","repository":{"id":135783753,"uuid":"205861836","full_name":"curegit/halftone-converter","owner":"curegit","description":"An image converter to create high quality halftone images","archived":false,"fork":false,"pushed_at":"2025-04-10T15:10:09.000Z","size":20569,"stargazers_count":27,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T10:33:25.430Z","etag":null,"topics":["cairo","cmyk-colors","halftone","image-processing","pillow"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/halftone-converter/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curegit.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,"zenodo":null}},"created_at":"2019-09-02T13:21:08.000Z","updated_at":"2025-04-30T14:02:52.000Z","dependencies_parsed_at":"2023-10-26T07:33:38.734Z","dependency_job_id":"141e00d5-141a-4058-a22f-cc8b7f684797","html_url":"https://github.com/curegit/halftone-converter","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curegit%2Fhalftone-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curegit%2Fhalftone-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curegit%2Fhalftone-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curegit%2Fhalftone-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curegit","download_url":"https://codeload.github.com/curegit/halftone-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252860128,"owners_count":21815474,"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":["cairo","cmyk-colors","halftone","image-processing","pillow"],"created_at":"2024-11-17T20:51:26.596Z","updated_at":"2025-05-07T10:34:21.728Z","avatar_url":"https://github.com/curegit.png","language":"Python","readme":"# Halftone Converter\n\nAn image converter to create high quality halftone images\n\n## Key Features\n\n- Easily halftone your images\n- High-quality rendering using Cairo graphics library\n- Halftones of 3 color types – Gray, RGB, and CMYK\n- Color space transformation using ICC profiles\n\n![Colorful Play Balls](images/colorful-play-balls.png)\n\n## Install\n\n```sh\npip3 install halftone-converter\n```\n\n### Requirements\n\nThis application can be run from Python3 on any OS.\nNote that [Pycairo requires Cairo core library](https://pycairo.readthedocs.io/en/latest/getting_started.html).\n\n- Python \u003e= 3.9\n- NumPy \u003e= 1.24\n- Pillow \u003e= 9.3\n- Pycairo \u003e= 1.23\n- Rich \u003e= 13.0\n\n## Usage\n\n### Quickstart\n\nThis application takes image files as input and outputs halftones as image files.\n\n```sh\nhalftonecv INPUT.png\n```\n\n### Synopsis\n\nThe main program can be invoked either through the `halftonecv` command or through the Python main module option `python3 -m halftonecv`.\nIt has command line interface as shown below.\n\n```txt\nusage: halftonecv [-h] [-v] [-q] [-V] [-e] [-g]\n                  [-f] [-O | -d DIR] [-P PREFIX] [-S SUFFIX]\n                  [-E [START]] [-p PX] [-x SCALE] [-b [{box,gaussian}]]\n                  [-B PX] [-F {nearest,linear,lanczos2,lanczos3,spline36}]\n                  [-A DEG] [-t DEG DEG DEG] [-a DEG DEG DEG DEG]\n                  [-m {auto,gray,rgb,cmyk}] [-o {auto,gray,rgb,cmyk}] [-T]\n                  [-G GRAY_ICC_FILE] [-I RGB_ICC_FILE] [-M CMYK_ICC_FILE]\n                  [-L GRAY_ICC_FILE] [-l {per,sat,rel,abs,0,1,2,3}]\n                  [-R RGB_ICC_FILE] [-r {per,sat,rel,abs,0,1,2,3}]\n                  [-C CMYK_ICC_FILE] [-c {per,sat,rel,abs,0,1,2,3}] [-H] [-X]\n                  [--ignore] [--discard] [--opaque] [--naive] [--gamma-correction]\n                  [--key RATE] [-K] [--keep-red] [--keep-green] [--keep-blue]\n                  [--keep-cyan] [--keep-magenta] [--keep-yellow] [--keep-key]\n                  FILE [FILE ...]\n```\n\n### Positional Arguments\n\n#### FILE\n\ndescribe input image files (required), can be multiple\n\nPass `-` to specify standard input.\n\nInput images must be in a format that Pillow can read.\nAlso, their color mode must be Gray (L, grayscale), LA (grayscale with alpha), RGB, RGBA, P (GIF, palette based images), or CMYK.\n\n### Optional Arguments\n\n#### -h, --help\n\nshow the help message and exit\n\n#### -v, --version\n\nshow program's version number and exit\n\n#### -q, --quiet\n\nsuppress non-error messages\n\n#### -V, --traceback\n\nrender tracebacks on error\n\n#### -e, --exit\n\nstop the program immediately by an error even if jobs remain\n\nBy default, it skips failed jobs (corrupted images, etc.) and starts the next one.\n\n#### -g, --glob\n\ninterpret `FILE` values as glob patterns (e.g., `*.png`, `**/*.jpg`)\n\nUse this option if the shell's wildcard expansion is not available and enough.\nPattern `**` matches any files and zero or more directories recursively.\nThis glob function will NOT include hidden files or directories.\n\n#### -f, --force\n\noverwrite existing files by outputs\n\nBy default, an alternate filename will be used if the original filename conflicts.\n\n#### -O, --stdout\n\nsend output to standard output\n\nOnly one image can be input when using this option.\n\n#### -d DIR, --directory DIR\n\nsave output images in `DIR` directory\n\nThe directory will be created automatically if it does not exist.\n\n#### -P PREFIX, --prefix PREFIX\n\nspecify a prefix string of output filenames\n\n#### -S SUFFIX, --suffix SUFFIX\n\nspecify a suffix string of output filenames\n\n#### -E [START], --enumerate [START]\n\nuse consecutive numbers as output filenames\n\nIt counts up by one from `START`.\nThe default `START` is 1.\n\n#### -p PX, --pitch PX, --interval PX\n\narrange halftone dots at intervals of `PX` pixels in input images\n\nChange this value for desired results.\nThe default value is 4.0.\n\n#### -x SCALE, -s SCALE, --scale SCALE\n\nthe scale factor of output images to input images\n\nThe default value is 1.0.\n\n#### -b [{box,gaussian}], --blur [{box,gaussian}]\n\napply blur effect to source images\n\nIf no blur type is specified, gaussian is used.\n\n#### -B PX, --blur-radius PX\n\nspecify blur radius\n\nIf not specified, half of the pitch is used.\n\n#### -F {nearest,linear,lanczos2,lanczos3,spline36}, --resample {nearest,linear,lanczos2,lanczos3,spline36}\n\nresampling method for determining dot size\n\nThe default is `linear`.\n\n#### -A DEG, --angle DEG, --gray-angle DEG\n\narrange dots by `DEG` degrees in Gray channel\n\n#### -t DEG DEG DEG, --Angles DEG DEG DEG, --rgb-angles DEG DEG DEG\n\narrange dots by `DEG` degrees in each RGB channels respectively\n\n#### -a DEG DEG DEG DEG, --angles DEG DEG DEG DEG, --cmyk-angles DEG DEG DEG DEG\n\narrange dots by `DEG` degrees in each CMYK channels respectively\n\n#### -m {auto,gray,rgb,cmyk}, --mode {auto,gray,rgb,cmyk}\n\ncolor space type to generate halftones\n\nThe default is `auto`.\nIt means that Gray images will be Gray halftones, and colored images will be CMYK halftones.\n\n#### -o {auto,gray,rgb,cmyk}, --output {auto,gray,rgb,cmyk}\n\ncolor space type to save output images\n\nThe default is `auto`.\nIt means that Gray images will be saved as Gray images, and colored images will be saved as RGB images.\n\n#### -T, --tiff, --out-tiff\n\nsave TIFF images instead of PNG images\n\nCMYK images will always be saved in TIFF regardless of this option.\n\n#### -G GRAY_ICC_FILE, --input-gray-profile GRAY_ICC_FILE\n\nspecify ICC profile for input Gray images\n\n#### -I RGB_ICC_FILE, --input-rgb-profile RGB_ICC_FILE\n\nspecify ICC profile for input RGB images\n\n#### -M CMYK_ICC_FILE, --input-cmyk-profile CMYK_ICC_FILE\n\nspecify ICC profile for input CMYK images\n\n#### -L GRAY_ICC_FILE, --gray-profile GRAY_ICC_FILE\n\nspecify ICC profile for transform to Gray images\n\n#### -l {per,sat,rel,abs,0,1,2,3}, --gray-intent {per,sat,rel,abs,0,1,2,3}\n\nrendering intent for transform to Gray images\n\n#### -R RGB_ICC_FILE, --rgb-profile RGB_ICC_FILE\n\nspecify ICC profile for transform to RGB images\n\n#### -r {per,sat,rel,abs,0,1,2,3}, --rgb-intent {per,sat,rel,abs,0,1,2,3}\n\nrendering intent for transform to RGB images\n\n#### -C CMYK_ICC_FILE, --cmyk-profile CMYK_ICC_FILE\n\nspecify ICC profile for transform to CMYK images\n\n#### -c {per,sat,rel,abs,0,1,2,3}, --cmyk-intent {per,sat,rel,abs,0,1,2,3}\n\nrendering intent for transform to CMYK images\n\n#### -H, --allow-huge\n\ndisable the limitation of input image size\n\nBe careful in the context of server-side applications.\nThis option may make DoS attacks possible (Decompression bomb).\n\n#### -X, --orientation\n\napply Exif orientation\n\n#### --ignore, --ignore-embedded-profile\n\ndon't respect ICC profiles embedded in input images\n\n#### --discard, --discard-profile\n\ndon't embed ICC profiles in output images\n\n#### --opaque, --discard-alpha\n\ndrop alpha channel from output\n\n#### --naive, --naive-transform\n\nuse approximate color space conversion algorithm (naive transform) instead of ICC profile-based transform\n\n#### --gamma-correction\n\napply sRGB gamma correction for RGB-CMYK conversion when the naive transform is used\n\n#### --key RATE, --key-from RATE\n\nblack ingredient threshold within 0.0-1.0 for RGB-CMYK conversion when the naive transform is used\n\n#### -K, --keep-all\n\ndon't convert any channels to halftones\n\nThis is useful for previewing color space transformation.\n\n#### --keep-red\n\ndon't convert R channels to halftones\n\n#### --keep-green\n\ndon't convert G channels to halftones\n\n#### --keep-blue\n\ndon't convert B channels to halftones\n\n#### --keep-cyan\n\ndon't convert C channels to halftones\n\n#### --keep-magenta\n\ndon't convert M channels to halftones\n\n#### --keep-yellow\n\ndon't convert Y channels to halftones\n\n#### --keep-key\n\ndon't convert K channels to halftones\n\n## Gallery\n\n### RGB\n\n![Blue Hyacinths](images/blue-hyacinths.png)\n\n### CMYK\n\n![Todai Ramen](images/lighthouse-ramen.png)\n\n### CMYK (Japan Color 2011 Coated)\n\nExample with user's custom ICC profile\n\n![Anime Girl](images/anime-girl.png)\n\n### Gray\n\n![Chevrolet Opala 87](images/chevrolet-opala.png)\n\n## Acknowledgments\n\nThis application contains some default ICC profiles to convert images between different color spaces.\n`sGray.icc`, `sRGB.icc` and `SWOP.icc` are provided by Artifex Software as a part of [GPL Ghostscript](https://www.ghostscript.com/) under the [GNU Affero General Public License v3.0](https://www.gnu.org/licenses/agpl-3.0.html).\n\n## License\n\nGNU Affero General Public License v3.0 or later\n\nCopyright (C) 2025 curegit\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License along with this program. If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuregit%2Fhalftone-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuregit%2Fhalftone-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuregit%2Fhalftone-converter/lists"}