{"id":45169418,"url":"https://github.com/tingjiainfuture/pixrep","last_synced_at":"2026-03-07T10:04:38.409Z","repository":{"id":337954224,"uuid":"1155406598","full_name":"TingjiaInFuture/pixrep","owner":"TingjiaInFuture","description":"Let LLMs see your codebase just like you do.","archived":false,"fork":false,"pushed_at":"2026-02-22T12:01:28.000Z","size":660,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-22T18:24:26.217Z","etag":null,"topics":["context-window","llm","multimodal","pdf-generation","token-optimization"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pixrep","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/TingjiaInFuture.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":"2026-02-11T13:33:02.000Z","updated_at":"2026-02-22T11:58:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TingjiaInFuture/pixrep","commit_stats":null,"previous_names":["tingjiainfuture/pixcode","tingjiainfuture/pixrep"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/TingjiaInFuture/pixrep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TingjiaInFuture%2Fpixrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TingjiaInFuture%2Fpixrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TingjiaInFuture%2Fpixrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TingjiaInFuture%2Fpixrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TingjiaInFuture","download_url":"https://codeload.github.com/TingjiaInFuture/pixrep/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TingjiaInFuture%2Fpixrep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30212021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: 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":["context-window","llm","multimodal","pdf-generation","token-optimization"],"created_at":"2026-02-20T08:00:36.779Z","updated_at":"2026-03-07T10:04:38.404Z","avatar_url":"https://github.com/TingjiaInFuture.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n\n# \u003cimg src=\"https://github.com/user-attachments/assets/2d378b5c-bfd9-4105-a8c2-ce67f8d542fa\" width=\"60\" alt=\"pixrep logo\" style=\"vertical-align: middle;\" /\u003e pixrep\n\n\n# 📉 SAVE UP TO 90% TOKENS\n\n### Turn Codebases into **Visual Context** for Multimodal LLMs\n\n\n[![PyPI version](https://img.shields.io/pypi/v/pixrep?color=blue)](https://pypi.org/project/pixrep/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub Stars](https://img.shields.io/github/stars/TingjiaInFuture/pixrep?style=social)](https://github.com/TingjiaInFuture/pixrep)\n\n\u003c/div\u003e\n\n---\n\n## 📖 Introduction\n\n**pixrep** is a developer tool designed to bridge the gap between large code repositories and Multimodal Large Language Models.\n\nInstead of feeding raw text that consumes massive context windows, **pixrep** converts your repository into a **structured, hierarchical set of PDFs**. This allows you to:\n\n*   **Save 90% Tokens:** Visual encoding is far more efficient than text tokenization.\n*   **Test for Free:** Easily share your entire codebase with premium models (like **Claude Opus 4.6**) on platforms like **arena.ai** without hitting text limits.\n\n\n## 🚀 Why Visual Code?\n\nTraditional text tokenization is expensive. Visual encoding compresses structure efficiently.\n\n*Comparison in Google AI Studio (Gemini 3 Pro):*\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth width=\"50%\"\u003eRaw Files (Text Input)\u003c/th\u003e\n    \u003cth width=\"50%\"\u003epixrep OnePDF (Visual Input)\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://github.com/user-attachments/assets/44dc5c5f-5913-4eb6-b20c-d020cfc57fe1\" width=\"100%\" alt=\"Raw Files Usage\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://github.com/user-attachments/assets/822ae56b-e9d3-4c2c-847f-21bd5341971c\" width=\"100%\" alt=\"OnePDF Usage\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003cb\u003e31,812 Tokens\u003c/b\u003e ❌\u003cbr\u003e\u003ci\u003e(Cluttered context)\u003c/i\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003cb\u003e19,041 Tokens\u003c/b\u003e ✅\u003cbr\u003e\u003ci\u003e(Clean, single file)\u003c/i\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## 🎓 Academic Backing \n\nThe core philosophy of **pixrep** (rendering code → PDF with syntax highlighting + heatmaps) has been validated by top-tier papers from 2025–2026:\n\n*   **Text or Pixels? It Takes Half** (arXiv:2510.18279): Rendering text as images saves **~50% decoder tokens** while maintaining or improving performance.\n*   **DeepSeek-OCR** (arXiv:2510.18234): Visual encoding achieves **10–20× compression ratios** for dense, structured text.\n*   **CodeOCR** (arXiv:2602.01785, Feb 2026): A **code-specific** study showing that visual input with syntax highlighting improves performance even at **4× compression**. In tasks like clone detection, the visual approach outperforms plain text.\n\n**Verdict:** In the multimodal era, the optimal way to feed code is via **\"visual perception\" rather than \"text reading.\"**\n\n## ✨ Features\n\n*   **📉 High Efficiency:** Drastically reduces context window usage for large repos.\n*   **⚡ Faster Scanning:** Single-pass file loading (binary check + line count + optional content decode) to reduce I/O overhead.\n*   **🎨 Syntax Highlighting:** Supports 50+ languages (Python, JS, Rust, Go, C++, etc.) with a \"One Dark\" inspired theme.\n*   **🧠 Semantic Minimap:** Auto-generates per-file micro UML / call graph summaries to expose structure at a glance.\n*   **🔥 Linter Heatmap:** Integrates `ruff` / `eslint` findings and marks risky lines with red/yellow visual overlays.\n*   **🔎 Query Mode:** Search by text or semantic symbols, then render only matched snippets to PDF/PNG.\n*   **🗂️ Hierarchical Output:** Generates a clean `00_INDEX.pdf` summary and separate files for granular access.\n*   **🌏 CJK Support:** Built-in font fallback for Chinese/Japanese/Korean characters (Auto-detects OS fonts).\n*   **🛡️ Smart Filtering:** Respects `.gitignore` patterns and supports custom ignore rules.\n*   **📊 Insightful Stats:** Calculates line counts and language distribution automatically.\n*   **🧾 Scan Diagnostics:** Prints scan summary (`seen/loaded/ignored/binary/errors`) for faster troubleshooting.\n\n## 📦 Installation\n\n```bash\npip install pixrep\n```\n\nFor PNG output support (`--format png`), install optional extras:\n\n```bash\npip install \"pixrep[png]\"\n```\n\n## 🛠️ Usage\n\n### Quick Start\nConvert the current directory to hierarchial PDFs in `./pixrep_output/\u003crepo_name\u003e`:\n\n```bash\npixrep .\n```\n\n**Or pack everything into a single, token-optimized PDF (Recommended for LLMs):**\n\n```bash\npixrep onepdf .\n```\n\n### Common Commands\n\n**Generate PDFs for a specific repo:**\n```bash\npixrep generate /path/to/my-project -o ./my-project-pdfs\n```\n\n**Pack core code into a single minimized PDF (all-in-one):**\n```bash\npixrep onepdf /path/to/my-project -o ./ONEPDF_CORE.pdf\n```\nNotes:\n* Defaults to `git ls-files` (tracked files) when available.\n* Defaults to \"core-only\" filtering (skips docs/tests); use `--no-core-only` to include them.\n\n**Preview structure and stats (without generating PDFs):**\n```bash\npixrep list /path/to/my-project\n```\n`list` mode now uses lightweight scanning (no file content decode), so large repos respond significantly faster.\n\n**Show only top 5 languages in the summary:**\n```bash\npixrep list . --top-languages 5\n```\n\n**Query and render only matching snippets:**\n```bash\npixrep query . -q \"cache\" --glob \"*.py\" --format png\n```\n\n**Semantic query (Python symbols) with interactive terminal preview:**\n```bash\npixrep query . -q \"CodeInsight\" --semantic --tui\n```\n\n### CLI Reference\n\n| Argument | Description | Default |\n| :--- | :--- | :--- |\n| `repo` | Path to the code repository. | `.` (Current Dir) |\n| `-o`, `--output` | Directory to save the generated PDFs. | `./pixrep_output/\u003crepo\u003e` |\n| `--max-size` | Max file size to process (in KB). Files larger than this are skipped. | `512` KB |\n| `--ignore` | Additional glob patterns to ignore (e.g., `*.json` `test/*`). | `[]` |\n| `--index-only` | Generate only the `00_INDEX.pdf` (Directory tree \u0026 stats). | `False` |\n| `--disable-semantic-minimap` | Turn off per-file semantic UML/callgraph panel. | `False` |\n| `--disable-lint-heatmap` | Turn off linter-based line heatmap background. | `False` |\n| `--linter-timeout` | Timeout seconds for each linter command. | `20` |\n| `--list-only` | Print the directory tree and stats to console, then exit. | `False` |\n| `-V`, `--version` | Show version information. | - |\n\n## ⚙️ Performance Notes\n\n`pixrep` now applies two execution paths:\n\n1. **Light scan path** (`pixrep list`, `pixrep generate --index-only`, `--list-only`):\n   only metadata and line counts are collected; file content is not loaded.\n2. **Full scan path** (regular `pixrep generate`):\n   file content is decoded only when needed for PDF rendering.\n\nThis reduces memory pressure and disk I/O for repository exploration workflows.\n\nLint/semantic caches are now stored in user cache directories by default:\n\n* Windows: `%LOCALAPPDATA%/pixrep/cache/\u003crepo_name\u003e`\n* Linux/macOS: `$XDG_CACHE_HOME/pixrep/\u003crepo_name\u003e` or `~/.cache/pixrep/\u003crepo_name\u003e`\n\nYou can override with `PIXREP_CACHE_DIR`.\n\n## 📂 Output Structure\n\nAfter running `pixrep .`, you will get a folder structure optimized for LLM upload:\n\n```text\npixrep_output/pixrep/\n├── 00_INDEX.pdf             # \u003c--- Upload this first! Contains tree \u0026 stats\n├── 001_LICENSE.pdf\n├── 002_README.md.pdf\n├── 003_pixrep___init__.py.pdf\n├── 005_pixrep_cli.py.pdf\n└── ...\n```\n\n## 🧩 Supported Languages\npixrep automatically detects and highlights syntax for:\n*   **Core:** Python, C, C++, Java, Rust, Go\n*   **Web:** HTML, CSS, JavaScript, TypeScript, Vue, Svelte\n*   **Config:** JSON, YAML, TOML, XML, Dockerfile, Ini\n*   **Scripting:** Bash, Lua, Perl, Ruby, PHP\n*   **And more:** Swift, Kotlin, Scala, Haskell, OCaml, etc.\n\n## 🤝 Contributing\n\nWe welcome contributions! Please feel free to submit a Pull Request.\n\n1.  Fork the repository.\n2.  Create your feature branch (`git checkout -b feature/AmazingFeature`).\n3.  Commit your changes (`git commit -m 'Add some AmazingFeature'`).\n4.  Push to the branch (`git push origin feature/AmazingFeature`).\n5.  Open a Pull Request.\n\n## 📄 License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftingjiainfuture%2Fpixrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftingjiainfuture%2Fpixrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftingjiainfuture%2Fpixrep/lists"}