{"id":17272484,"url":"https://github.com/hbldh/hitherdither","last_synced_at":"2025-06-16T19:36:23.273Z","repository":{"id":11037978,"uuid":"68096871","full_name":"hbldh/hitherdither","owner":"hbldh","description":"Dithering algorithms for arbitrary palettes in PIL","archived":false,"fork":false,"pushed_at":"2023-09-18T14:16:25.000Z","size":63,"stargazers_count":229,"open_issues_count":4,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-10T01:12:46.510Z","etag":null,"topics":["dithering","dithering-algorithms","dithering-images","pil","pillow"],"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/hbldh.png","metadata":{"files":{"readme":"README.rst","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":"2016-09-13T10:02:01.000Z","updated_at":"2025-04-09T12:14:16.000Z","dependencies_parsed_at":"2024-12-26T19:06:51.239Z","dependency_job_id":"4e76798f-e9b7-478b-baaa-a91c567e96a3","html_url":"https://github.com/hbldh/hitherdither","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbldh%2Fhitherdither","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbldh%2Fhitherdither/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbldh%2Fhitherdither/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbldh%2Fhitherdither/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hbldh","download_url":"https://codeload.github.com/hbldh/hitherdither/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137890,"owners_count":21053775,"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":["dithering","dithering-algorithms","dithering-images","pil","pillow"],"created_at":"2024-10-15T08:48:45.966Z","updated_at":"2025-04-10T01:12:48.810Z","avatar_url":"https://github.com/hbldh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"hitherdither\n============\n\n|Build Status| |Coverage Status|\n\nA package inspired by [1]_, implementing dithering algorithms that can be used with \n`PIL/Pillow \u003chttps://pillow.readthedocs.io/en/3.3.x/\u003e`_. \n\nDescription\n-----------\n\nThis module is a small extension to `PIL/Pillow \u003chttps://pillow.readthedocs.io/en/3.3.x/\u003e`_, adding\na more managable palette object and several dithering algorithms:\n\n* Error diffusion dithering\n    - Floyd-Steinberg\n    - Jarvis-Judice-Ninke\n    - Stucki\n    - Burkes\n    - Sierra3 \n    - Sierra2\n    - Sierra-2-4A\n    - Stevenson-Arce\n    - Atkinson\n* Standard ordered dithering\n    - Bayer matrix\n    - Cluster dot matrix\n    - Arbitrary square threshold matrix (not implemented yet)\n* Yliluoma's ordered dithering (see [1]_)\n    - Algorithm 1 \n    - Algorithm 2 (not implemented yet)\n    - Algorithm 3 (not implemented yet)\n\nThe dithering algorithms are applicable for arbitrary palettes and for both\nRGB and greyscale images.\n\nInstallation\n------------\n\n::\n\n    pip install git+https://www.github.com/hbldh/hitherdither\n\nUsage\n-----\n\nBayer dithering using a median cut palette:\n\n.. code:: python\n\n   from PIL import Image\n   import hitherdither\n\n   img = Image.open('image.jpg')\n   palette = hitherdither.palette.Palette.create_by_median_cut(img)\n   img_dithered = hitherdither.ordered.bayer.bayer_dithering(\n       img, palette, [256/4, 256/4, 256/4], order=8)\n\n`Yliluoma's Algorithm 1 \u003chttp://bisqwit.iki.fi/story/howto/dither/jy/#YliluomaSOrderedDitheringAlgorithm 1\u003e`_\nusing a predefined palette:\n\n.. code:: python\n\n   from PIL import Image\n   import hitherdither\n\n   palette = hitherdither.palette.Palette(\n       [0x080000, 0x201A0B, 0x432817, 0x492910,\n        0x234309, 0x5D4F1E, 0x9C6B20, 0xA9220F,\n        0x2B347C, 0x2B7409, 0xD0CA40, 0xE8A077,\n        0x6A94AB, 0xD5C4B3, 0xFCE76E, 0xFCFAE2]\n   )\n\n   img = Image.open('image.jpg')\n   img_dithered = hitherdither.ordered.yliluoma.yliluomas_1_ordered_dithering(\n       img, palette, order=8)\n\nTests\n~~~~~\n\nTests can be run with `pytest \u003chttp://doc.pytest.org/en/latest/\u003e`_:\n\n.. code:: sh\n\n    hbldh@devbox:~/Repos/hitherdither$ py.test tests\n    ============================= test session starts ==============================\n    platform linux -- Python 3.5.2, pytest-3.0.2, py-1.4.31, pluggy-0.3.1\n    rootdir: /home/hbldh/Repos/hitherdither, inifile: \n    collected 13 items \n\n    tests/test_bayer.py ...\n    tests/test_palette.py ..........\n\n    ========================== 13 passed in 0.11 seconds ===========================\n\nReferences\n----------\n\n.. [1] Joel Yliluoma's arbitrary-palette positional dithering algorithm (http://bisqwit.iki.fi/story/howto/dither/jy/)\n\n\n.. |Build Status| image:: https://github.com/hbldh/hitherdither/workflows/Build%20and%20Test/badge.svg\n   :target: https://github.com/hbldh/hitherdither/actions?query=workflow%3A%22Build+and+Test%22\n   :alt: Build and Test\n.. |Coverage Status| image:: https://coveralls.io/repos/github/hbldh/hitherdither/badge.svg?branch=master\n   :target: https://coveralls.io/github/hbldh/hitherdither?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbldh%2Fhitherdither","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhbldh%2Fhitherdither","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbldh%2Fhitherdither/lists"}