{"id":50671006,"url":"https://github.com/bugzmanov/djvu-rs","last_synced_at":"2026-06-08T11:03:27.219Z","repository":{"id":343440911,"uuid":"1177743596","full_name":"bugzmanov/djvu-rs","owner":"bugzmanov","description":"Pure Rust DjVu document reader and renderer","archived":false,"fork":false,"pushed_at":"2026-03-10T11:22:23.000Z","size":23336,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-10T17:44:06.741Z","etag":null,"topics":["djvu","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bugzmanov.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-03-10T10:25:23.000Z","updated_at":"2026-03-10T11:22:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bugzmanov/djvu-rs","commit_stats":null,"previous_names":["bugzmanov/djvu-rs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bugzmanov/djvu-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugzmanov%2Fdjvu-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugzmanov%2Fdjvu-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugzmanov%2Fdjvu-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugzmanov%2Fdjvu-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugzmanov","download_url":"https://codeload.github.com/bugzmanov/djvu-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugzmanov%2Fdjvu-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34059157,"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-06-08T02:00:07.615Z","response_time":111,"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":["djvu","rust"],"created_at":"2026-06-08T11:03:26.426Z","updated_at":"2026-06-08T11:03:27.208Z","avatar_url":"https://github.com/bugzmanov.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# djvu\n\nPure Rust library for parsing and rendering [DjVu](https://en.wikipedia.org/wiki/DjVu) documents.\n\n## Disclaimer\n\nThis is an AI-assisted project. The implementation is semi-clean room: format\nspecs were derived from the public DjVu3 specification, but DjVu has many quirks\nand underspecified details that the spec alone doesn't cover. In order to produce\nreadable rendering output, algorithm details were studied from\n[djvu.js](https://github.com/RussCoder/djvujs) (GPL JavaScript renderer) and\n[DjVuLibre](http://djvu.sourceforge.net/) (GPL C++ reference implementation).\nNo code was copied from either project. Test DjVu files are borrowed from\ndjvu.js, and golden test outputs are generated using DjVuLibre command-line\ntools (`ddjvu`, `djvused`, `djvudump`).\n\nFor all intents and purposes this should be considered AI slop. That said, some\neffort has been put into making the library performant and stable. It is used as\nthe DjVu rendering engine in [Bookokrat](https://bugzmanov.github.io/bookokrat/index.html).\n\n## Features\n\n- Full DjVu document parsing (single-page and bundled multi-page)\n- IW44 wavelet decoding (background and foreground color layers)\n- JB2 bilevel decoding (mask/text layer) with shared dictionary support\n- 3-layer compositing with bilinear interpolation\n- Text extraction (TXTz/TXTa OCR layers)\n- Thumbnail extraction (TH44)\n- Bookmark / table of contents (NAVM)\n- Page rotation support\n- Anti-aliased downscaling with configurable boldness\n- No unsafe code in the public API crate\n- No C dependencies\n\n## Usage\n\n```rust\nlet doc = djvu::Document::open(\"file.djvu\")?;\nprintln!(\"{} pages\", doc.page_count());\n\nlet page = doc.page(0)?;\nprintln!(\"{}x{} @ {} dpi\", page.width(), page.height(), page.dpi());\n\n// Render to RGBA pixmap\nlet pixmap = page.render()?;\nlet rgba_bytes: \u0026[u8] = pixmap.as_ref();\n\n// Or get raw RGB\nlet rgb = pixmap.to_rgb();\n\n// Extract text (if OCR layer exists)\nif let Some(text) = page.text()? {\n    println!(\"{}\", text);\n}\n\n// Thumbnails\nif let Some(thumb) = page.thumbnail()? {\n    println!(\"Thumbnail: {}x{}\", thumb.width, thumb.height);\n}\n```\n\n## Not Supported\n\n- **Indirect multi-page documents** — only single-page and bundled multi-page files are supported; indirect documents (pages split across separate files) will return an error\n- **Annotations and hyperlinks** (ANTz/ANTa) — not parsed\n- **Encoding / writing** — this is a read-only library\n- **CCITT/G4 fax encoding** — only JB2 and IW44 codecs are implemented\n\n## Examples\n\n```bash\ncargo run --example render_page -- file.djvu 0 /tmp/page.ppm\ncargo run --example extract_text -- file.djvu\ncargo run --example page_info -- file.djvu\n```\n\n## License\n\nGPL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugzmanov%2Fdjvu-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugzmanov%2Fdjvu-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugzmanov%2Fdjvu-rs/lists"}