{"id":37072414,"url":"https://github.com/guardkenzie/chafa.py","last_synced_at":"2026-01-14T08:30:08.683Z","repository":{"id":65186832,"uuid":"574718659","full_name":"GuardKenzie/chafa.py","owner":"GuardKenzie","description":"Python bindings for Chafa. Visualize images with text in python.","archived":false,"fork":false,"pushed_at":"2025-06-22T19:29:28.000Z","size":7382,"stargazers_count":110,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-05T00:12:01.318Z","etag":null,"topics":["bindings","chafa","graphics","image-viewer","python","terminal","terminal-based","terminal-graphics"],"latest_commit_sha":null,"homepage":"https://chafapy.mage.black","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GuardKenzie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2022-12-05T23:31:19.000Z","updated_at":"2026-01-04T22:49:26.000Z","dependencies_parsed_at":"2023-10-22T13:32:06.149Z","dependency_job_id":"509d94c3-aa93-44c1-8cfb-547ee732a5cd","html_url":"https://github.com/GuardKenzie/chafa.py","commit_stats":{"total_commits":247,"total_committers":3,"mean_commits":82.33333333333333,"dds":0.09716599190283404,"last_synced_commit":"0a7c202449af58ff8b73887b6341fa81163bc78e"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/GuardKenzie/chafa.py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuardKenzie%2Fchafa.py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuardKenzie%2Fchafa.py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuardKenzie%2Fchafa.py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuardKenzie%2Fchafa.py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuardKenzie","download_url":"https://codeload.github.com/GuardKenzie/chafa.py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuardKenzie%2Fchafa.py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bindings","chafa","graphics","image-viewer","python","terminal","terminal-based","terminal-graphics"],"created_at":"2026-01-14T08:30:07.904Z","updated_at":"2026-01-14T08:30:08.661Z","avatar_url":"https://github.com/GuardKenzie.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" \u003e\n  \u003cp\u003e\u0026nbsp;\u003c/p\u003e\n  \u003cimg width=500 alt=\"chafa.py\" src=\"https://github.com/GuardKenzie/chafa.py/blob/main/img/logo.svg?raw=true\"\u003e\n  \u003cp\u003e\u0026nbsp;\u003c/p\u003e\n  \u003cp\u003e\n    \u003cem\u003eTerminal graphics with Python!\u003c/em\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n      \u003ca href=\"https://chafapy.mage.black/\"\u003e📙 Docs\u003c/a\u003e\u0026nbsp;\u0026nbsp;-\u0026nbsp;\u0026nbsp;\u003ca href=\"https://chafapy.mage.black/usage/tutorial.html\"\u003e🌱 Tutorial\u003c/a\u003e\u0026nbsp;\u0026nbsp;-\u0026nbsp;\u0026nbsp;\u003ca href=\"https://chafapy.mage.black/usage/examples/examples.html\"\u003e💾 Examples\u003c/a\u003e\n  \u003c/p\u003e\n \u003cp\u003e—\u003c/p\u003e\n  \u003cp\u003e\n    \u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/chafa.py?label=version\u0026style=flat-square\"\u003e\n    \u0026nbsp;\n    \u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/GuardKenzie/chafa.py/build_wheels.yml?style=flat-square\"\u003e\n    \u0026nbsp;\n    \u003cimg alt=\"Sneks\" src=\"https://img.shields.io/badge/snakes%20go-sssss-cbd446?style=flat-square\"\u003e  \n  \u003c/p\u003e\n\u003c/div\u003e\n\n# What is this?\n\nHave you ever wanted to display an image in your TUI Python application? Well, now you can!\n\n[Chafa](https://hpjansson.org/chafa/) is a wonderful command-line utility, \ncreated by [Hans Petter Jansson](https://hpjansson.org/), for visualizing \nimages in the terminal. In Jansson's own words:\n  \n\u003e **The future is (still) now!**\n\u003e\n\u003e  The premier UX of the 21st century just got a little better: \n\u003e With `chafa`, you can now view very, very reasonable approximations \n\u003e of pictures and animations in the comfort of your favorite terminal \n\u003e emulator. The power of ANSI X3.64 compels you!\n\nchafa.py is a python wrapper for the chafa library so you can use rad graphics in your cool Python applications! The chafa.py library tries to be intuitive and aims to produce very readable code.\n\n### Features include:\n\n- ⚡ Modern and intuitive Python API\n- 📖 Extensive [documentation](https://chafapy.mage.black) and a [tutorial](https://chafapy.mage.black/usage/tutorial.html)\n- 📟 Generate text based approximations of images in (almost) any terminal emulator\n- [6️⃣ Sixels](https://www.arewesixelyet.com/), [😸 Kitty](https://sw.kovidgoyal.net/kitty/graphics-protocol/) and [🍎 ITerm2](https://iterm2.com/documentation-images.html) image protocols support\n- 🐧 Linux, 🍎 MacOS (x86 and ARM), 🪟 Windows support\n\n# Example\n\nHere is a [picture of a cute snake](https://chafapy.mage.black/_images/snake.jpg) rendered to text using chafa.py:\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/GuardKenzie/chafa.py/blob/main/img/readme_snake.jpg?raw=true\"\u003e\u003c/img\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003c/p\u003e\n\u003cdetails\u003e\n  \u003csummary\u003e✏️ Code\u003c/summary\u003e\n\n  For more examples, head on over to the docs at [chafapy.mage.black](https://chafapy.mage.black).\n  \n  ```python\n  from chafa import *\n  from chafa.loader import Loader\n\n  # The font ratio of JetBrains Mono (width/height)\n  FONT_RATIO = 11/24\n\n  # Create a canvas config\n  config = CanvasConfig()\n\n  # Configure the canvas geometry\n  config.width  = 40\n  config.height = 40\n\n  # Load the snake\n  image = Loader(\"./snake.jpg\")\n\n  # Configure the ideal canvas geometry based on our FONT_RATIO\n  config.calc_canvas_geometry(\n     image.width,\n     image.height,\n     FONT_RATIO\n  )\n\n  # Init the canvas\n  canvas = Canvas(config)\n\n  # Draw to the canvs\n  canvas.draw_all_pixels(\n     image.pixel_type,\n     image.get_pixels(),\n     image.width, image.height,\n     image.rowstride\n  )\n\n  # Print the output\n  output = canvas.print()\n\n  print(output.decode())\n  ```\n\u003c/details\u003e\n\n\n# Where can I get it?\n\nChafa.py is available on [PyPI](https://pypi.org/project/chafa.py/). You can install it by running\n\n```\npip install chafa.py\n```\n\nIf you want to use the included Loader class to load images, you will also need to install [MagickWand](https://imagemagick.org/script/magick-wand.php).\n\n### Dependencies\n\n- Python 3.8 or later\n\n### Optional Dependencies\n\n\n- [MagickWand](https://imagemagick.org/script/magick-wand.php) (for the [Loader](https://chafapy.mage.black/api/Loader.html) class)\n\n\u003cdetails\u003e\n\u003csummary\u003e📬 P.S. The snakes don't bite \u003cem\u003e(I think...)\u003c/em\u003e\u003c/summary\u003e\n    🐍🐍🐍🐍🐍\n\u003c/details\u003e \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguardkenzie%2Fchafa.py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguardkenzie%2Fchafa.py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguardkenzie%2Fchafa.py/lists"}