{"id":30866998,"url":"https://github.com/endernoke/ink-picture","last_synced_at":"2025-09-13T03:04:27.942Z","repository":{"id":313601139,"uuid":"1051941609","full_name":"endernoke/ink-picture","owner":"endernoke","description":"Like ink-image, but it works - Better image component for Ink CLI","archived":false,"fork":false,"pushed_at":"2025-09-07T15:10:53.000Z","size":165,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-07T22:03:33.641Z","etag":null,"topics":["ascii-art","cli","component","display","graphics","image","ink","jsx","photo","picture","react","sixel","terminal","viewer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/endernoke.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-07T03:49:42.000Z","updated_at":"2025-09-07T16:13:02.000Z","dependencies_parsed_at":"2025-09-07T08:39:59.706Z","dependency_job_id":"819c5822-e5ac-402d-9381-41c40d6e0cb7","html_url":"https://github.com/endernoke/ink-picture","commit_stats":null,"previous_names":["endernoke/ink-picture"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/endernoke/ink-picture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endernoke%2Fink-picture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endernoke%2Fink-picture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endernoke%2Fink-picture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endernoke%2Fink-picture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endernoke","download_url":"https://codeload.github.com/endernoke/ink-picture/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endernoke%2Fink-picture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274126885,"owners_count":25226725,"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-09-08T02:00:09.813Z","response_time":121,"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":["ascii-art","cli","component","display","graphics","image","ink","jsx","photo","picture","react","sixel","terminal","viewer"],"created_at":"2025-09-07T22:03:22.517Z","updated_at":"2025-09-08T23:04:02.671Z","avatar_url":"https://github.com/endernoke.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ink-picture\n\nBetter image component for [Ink](https://github.com/vadimdemedes/ink) CLI/TUI applications.\n\nDisplay images in your terminal with automatic protocol detection and graceful fallbacks. Supports ASCII, Braille patterns, Unicode half-blocks, and Sixel graphics.\n\n\u003cimg width=\"1919\" height=\"765\" alt=\"Screenshot 2025-09-07 160615\" src=\"https://github.com/user-attachments/assets/0be5be69-043a-446a-aa8a-7d138919113c\" /\u003e\n\n## Who's using ink-picture?\n\n- [Instagram CLI](https://github.com/supreme-gg-gg/instagram-cli): CLI and terminal client for Instagram\n\nFeel free to open a PR to showcase your project here!\n\n## Installation\n\n```bash\nnpm install ink-picture\n```\n\n## Basic Usage\n\n```tsx\nimport React from \"react\";\nimport { Box, render } from \"ink\";\nimport Image, { TerminalInfoProvider } from \"ink-picture\";\n\nfunction App() {\n  return (\n    \u003cTerminalInfoProvider\u003e\n      \u003cBox flexDirection=\"column\"\u003e\n        \u003cImage\n          src=\"https://example.com/image.jpg\"\n          width={40}\n          height={20}\n          alt=\"Example image\"\n        /\u003e\n      \u003c/Box\u003e\n    \u003c/TerminalInfoProvider\u003e\n  );\n}\n\nrender(\u003cApp /\u003e);\n```\n\n\u003e [!IMPORTANT]\n\u003e Always wrap your app with `TerminalInfoProvider` to enable automatic terminal capability detection.\n\n## API\n\n### `\u003cImage\u003e`\n\nMain component with automatic protocol detection and fallback.\n\n#### Props\n\n- `src` (string) - Image URL or file path. Supports all formats handled by Sharp (JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF)\n- `width?` (number) - Width in terminal cells\n- `height?` (number) - Height in terminal cells\n- `alt?` (string) - Alternative text for loading/error states\n- `protocol?` (string) - Force specific protocol: `\"ascii\"`, `\"braille\"`, `\"halfBlock\"`, `\"sixel\"` (`sixel` is experimental, see [Important Notes](#important-notes--caveats))\n\n#### Protocols\n\nThe component automatically selects the best available protocol:\n\n1. **Half-block** (`halfBlock`) - Color rendering with Unicode half-blocks (▄). Requires color + Unicode support.\n2. **Braille** (`braille`) - High-resolution monochrome using Braille patterns. Requires Unicode support.\n3. **ASCII** (`ascii`) - Character-based art. Works in all terminals (fallback).\n4. **Sixel** (`sixel`) - True color bitmap graphics. Requires Sixel support (experimental).\n\n### `\u003cTerminalInfoProvider\u003e`\n\nRequired wrapper component that detects terminal capabilities.\n\n```tsx\n\u003cTerminalInfoProvider\u003e{/* Your app components */}\u003c/TerminalInfoProvider\u003e\n```\n\n### Individual Components\n\nFor advanced usage, import specific renderers:\n\n```tsx\nimport {\n  AsciiImage,\n  BrailleImage,\n  HalfBlockImage,\n  SixelImage,\n} from \"ink-picture\";\n```\n\n### Hooks\n\n- `useTerminalInfo()` - Complete terminal information\n- `useTerminalDimensions()` - Terminal size in pixels and cells\n- `useTerminalCapabilities()` - Supported features (Unicode, color, graphics)\n\n## Important Notes \u0026 Caveats\n\n### Sixel Renderer (Experimental)\n\nThe Sixel renderer provides the highest quality but comes with important limitations:\n\n⚠️ **Experimental Warning:** The Sixel component bypasses React/Ink's normal rendering pipeline and writes directly to the terminal. You may experience:\n\n- Rendering flicker during updates\n- Cursor positioning issues\n- Cleanup problems on component unmount\n- Images may be gone after app termination\n\n### General Considerations\n\n- Images are fetched and processed asynchronously\n- Large images are automatically resized to fit terminal constraints\n- Remote images require network access\n- Terminal capability detection happens once per session\n\n## Examples\n\n### Static Gallery\n\n```tsx\n\u003cTerminalInfoProvider\u003e\n  \u003cBox flexDirection=\"row\" gap={2}\u003e\n    \u003cImage src=\"./photo1.jpg\" width={20} height={15} /\u003e\n    \u003cImage src=\"./photo2.jpg\" width={20} height={15} /\u003e\n    \u003cImage src=\"./photo3.jpg\" width={20} height={15} /\u003e\n  \u003c/Box\u003e\n\u003c/TerminalInfoProvider\u003e\n```\n\n### Force Specific Protocol\n\n```tsx\n\u003cImage src=\"./diagram.png\" protocol=\"braille\" alt=\"Technical diagram\" /\u003e\n```\n\n### Responsive Sizing\n\n```tsx\n{\n  /* Image will fit within container bounds */\n}\n\u003cBox width={50} height={30}\u003e\n  \u003cImage src=\"./large-image.jpg\" /\u003e\n\u003c/Box\u003e;\n```\n\n## Contributing\n\nContributions are welcome! To contribute:\n\n1. Open or comment on an issue describing what you want to change\n2. Fork the repository\n3. Create a feature branch: `git checkout -b feature/amazing-feature`\n4. Install dependencies: `npm install`\n5. Make your changes\n6. Run tests: `npm test`\n7. Open a pull request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendernoke%2Fink-picture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendernoke%2Fink-picture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendernoke%2Fink-picture/lists"}