{"id":51596914,"url":"https://github.com/crystallabs/pnggif","last_synced_at":"2026-07-11T19:30:40.801Z","repository":{"id":366470289,"uuid":"1275352268","full_name":"crystallabs/pnggif","owner":"crystallabs","description":"Crystal PNG/GIF parser with animation support","archived":false,"fork":false,"pushed_at":"2026-06-22T00:48:40.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-22T02:31:28.655Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crystallabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-20T15:22:48.000Z","updated_at":"2026-06-22T00:48:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/crystallabs/pnggif","commit_stats":null,"previous_names":["crystallabs/pnggif"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/crystallabs/pnggif","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2Fpnggif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2Fpnggif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2Fpnggif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2Fpnggif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crystallabs","download_url":"https://codeload.github.com/crystallabs/pnggif/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystallabs%2Fpnggif/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35374165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"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":[],"created_at":"2026-07-11T19:30:40.165Z","updated_at":"2026-07-11T19:30:40.796Z","avatar_url":"https://github.com/crystallabs.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pnggif\n\nPure-Crystal **PNG / APNG / GIF** reader.\n\nIt decodes an image file (or in-memory buffer) into RGBA bitmaps and, optionally,\na downscaled **terminal-cell map** suitable for solid-block rendering in a TUI\n(one cell per sampled pixel, the cell background set to the pixel color).\n\nPorted from [Blessed](https://github.com/chjj/blessed)'s bundled\n[`tng.js`](https://github.com/chjj/tng) (MIT).\n\n## Features\n\n- **PNG**: all color types (grayscale, RGB, palette, gray+alpha, RGBA), bit\n  depths 1–16, all scanline filters, Adam7 interlacing, palette transparency.\n  Decompression uses Crystal's stdlib `Compress::Zlib`.\n- **APNG**: animation frames with dispose/blend compositing.\n- **GIF** (87a/89a): ported LZW decoder, interlacing, transparency, NETSCAPE\n  loop counts, multi-frame animation.\n- **JPEG / other**: converted to PNG via ImageMagick `convert` when available.\n- **Cellmaps**: nearest-neighbour downscaling with non-square-cell **aspect\n  correction** (`cell_aspect`, default `2.0`) so images don't look stretched.\n\n## Usage\n\n```crystal\nrequire \"pnggif\"\n\nimg = PNGGIF::PNG.new(\"picture.png\", cell_width: 40)\n\nimg.width        # =\u003e image pixel width\nimg.height       # =\u003e image pixel height\nimg.bmp          # =\u003e Array(Array(PNGGIF::Pixel)), full-resolution RGBA\nimg.cellmap      # =\u003e downscaled bitmap, one PNGGIF::Pixel per terminal cell\nimg.frames       # =\u003e Array(PNGGIF::Frame)? for animations, else nil\n\n# Pre-composited animation frames ({cellmap, delay_ms}):\nif frames = img.animation_cellmaps(40)\n  frames.each { |cellmap, delay_ms| ... }\nend\n```\n\nEach `PNGGIF::Pixel` has `r`, `g`, `b`, `a` channels (0–255).\n\n## License\n\nAGPLv3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystallabs%2Fpnggif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystallabs%2Fpnggif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystallabs%2Fpnggif/lists"}