Display images in terminals using Unicode mosaics and ANSI colors
Project description
## AI Collaboration Context
**Project:** catpic - Terminal Image Viewer | **Session:** #1 | **Date:** 2025-01-27 | **Lead:** [Your Name]
**AI Model:** Claude Sonnet 4 | **Objective:** Create comprehensive catpic project structure
**Prior Work:** Initial session
**Current Status:** Complete project scaffolding with BASIS system and EnGlyph integration. Renamed to catpic with .meow extension
**Files in Scope:** New project - all files created
**Human Contributions:** Requirements analysis, EnGlyph research, BASIS system design, development strategy, UX design (viewer-first approach), naming (catpic/.meow)
**AI Contributions:** Project structure, code generation, documentation, testing framework
**Pending Decisions:** Phase 1 implementation approach, specific BASIS character sets for 2,3 and 2,4
catpic - Terminal Image Viewer
Display images directly in your terminal using mosaic block characters and ANSI colors.
Features
- Instant display: Show any image format directly in terminal with
catpic image.jpg - Animation support: Play GIFs directly with
catpic animation.gif - Cat-able files: Generate
.meowfiles for sharing over wire and scripting - Scalable quality: BASIS system from universal compatibility to ultra-high quality
- Modern Python: Built with UV, type hints, and comprehensive testing
Installation
# Using uv (recommended)
uv add catpic
# Using pip
pip install catpic
Quick Start
# Display any image directly in terminal
catpic photo.jpg
# Display animated GIF directly
catpic animation.gif
# Generate cat-able files when needed
catpic generate photo.jpg # Creates photo.meow
catpic convert animation.gif # Creates animation.meow
# Display cat-able files
cat photo.meow
catpic animation.meow # or cat animation.meow
BASIS System
catpic uses a pixel subdivision system for different quality/compatibility levels:
- BASIS 1,2: 4 patterns ( ▀▄█) - Universal terminal compatibility
- BASIS 2,2: 16 patterns (quadrant blocks) - Balanced quality/compatibility
- BASIS 2,3: 64 patterns (sextant blocks) - High quality
- BASIS 2,4: 256 patterns (Legacy Computing) - Ultra quality
MEOW Format
MEOW (Mosaic Encoding Over Wire) - A text-based format for terminal images that can be cat-ed, shared over SSH, and embedded in scripts.
Python API
from catpic import CatpicEncoder, CatpicDecoder, CatpicPlayer
# Display any image directly (primary use case)
encoder = CatpicEncoder(basis=(2, 2))
meow_content = encoder.encode_image('photo.jpg', width=80)
decoder = CatpicDecoder()
decoder.display(meow_content)
# Generate cat-able file
with open('photo.meow', 'w') as f:
f.write(meow_content)
# Animation
meow_anim = encoder.encode_animation('animation.gif')
player = CatpicPlayer()
player.play(meow_anim)
Development
# Setup development environment
uv sync --dev
# Run tests
uv run pytest
# Format code
uv run black src/ tests/
uv run ruff check src/ tests/
# Type checking
uv run mypy src/
License
MIT License - see LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file catpic-0.5.0.tar.gz.
File metadata
- Download URL: catpic-0.5.0.tar.gz
- Upload date:
- Size: 58.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5df560a6b5910709f5ea9ad9edf91584f61b13f69d084cd5a051c094bee54c26
|
|
| MD5 |
5ba698a79b0471e65846943eeee3df91
|
|
| BLAKE2b-256 |
4327afb620d41e016e37a4a6d7605e87191dc930573882dd12cb9a83efcbec79
|
File details
Details for the file catpic-0.5.0-py3-none-any.whl.
File metadata
- Download URL: catpic-0.5.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d42f5325ffaa504aa614697a596aee534150c19179a77078330d5431ea526f17
|
|
| MD5 |
58a11c33c2442937d90026386fe703f4
|
|
| BLAKE2b-256 |
267753f409008d249299f8baf733972c2e072906204e57feebac142316397dec
|