{"id":19936856,"url":"https://github.com/belphemur/cbzoptimizer","last_synced_at":"2026-06-14T07:33:01.624Z","repository":{"id":254943156,"uuid":"848042310","full_name":"Belphemur/CBZOptimizer","owner":"Belphemur","description":"CBZOptimizer is a Go-based tool designed to optimize CBZ (Comic Book Zip) files by converting images to a specified format and quality. This tool is useful for reducing the size of comic book archives while maintaining acceptable image quality.","archived":false,"fork":false,"pushed_at":"2026-06-08T17:02:50.000Z","size":78603,"stargazers_count":17,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-08T19:05:08.724Z","etag":null,"topics":["cbr","cbr-archive","cbz","cbz-archive","golang","optimization","webp"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Belphemur.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":"2024-08-27T02:51:03.000Z","updated_at":"2026-06-08T17:02:53.000Z","dependencies_parsed_at":"2024-08-27T04:15:29.997Z","dependency_job_id":"69cd8bf3-fc18-4264-9e58-abed24e64c89","html_url":"https://github.com/Belphemur/CBZOptimizer","commit_stats":null,"previous_names":["belphemur/cbzoptimizer"],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/Belphemur/CBZOptimizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Belphemur%2FCBZOptimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Belphemur%2FCBZOptimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Belphemur%2FCBZOptimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Belphemur%2FCBZOptimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Belphemur","download_url":"https://codeload.github.com/Belphemur/CBZOptimizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Belphemur%2FCBZOptimizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34313515,"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-14T02:00:07.365Z","response_time":62,"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":["cbr","cbr-archive","cbz","cbz-archive","golang","optimization","webp"],"created_at":"2024-11-12T23:29:34.078Z","updated_at":"2026-06-14T07:33:01.619Z","avatar_url":"https://github.com/Belphemur.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CBZOptimizer\n\nCBZOptimizer is a Go-based tool designed to optimize CBZ (Comic Book Zip) and CBR (Comic Book RAR) files by converting images to a specified format and quality. This tool is useful for reducing the size of comic book archives while maintaining acceptable image quality.\n\n**Note**: CBR files are supported as input but are always converted to CBZ format for output.\n\n## Features\n\n- Convert images within CBZ and CBR files to different formats (e.g., WebP).\n- Support for multiple archive formats including CBZ and CBR (CBR files are converted to CBZ format).\n- Adjust the quality of the converted images.\n- Process multiple chapters in parallel.\n- Option to override the original files (CBR files are converted to CBZ and original CBR is deleted).\n- Watch a folder for new CBZ/CBR files and optimize them automatically.\n- Set time limits for chapter conversion to avoid hanging on problematic files.\n\n## Installation\n\n### Download Binary\n\nDownload the latest release from [GitHub Releases](https://github.com/belphemur/CBZOptimizer/releases).\n\n### Docker\n\nPull the Docker image:\n\n```sh\ndocker pull ghcr.io/belphemur/cbzoptimizer:latest\n```\n\n## Usage\n\n### Command Line Interface\n\nThe tool provides CLI commands to optimize and watch CBZ/CBR files. Below are examples of how to use them:\n\n#### Optimize Command\n\nOptimize all CBZ/CBR files in a folder recursively:\n\n```sh\ncbzconverter optimize [folder] --quality 85 --parallelism 2 --override --format webp --split\n```\n\nThe format flag can be specified in multiple ways:\n\n```sh\n# Using space-separated syntax\ncbzconverter optimize [folder] --format webp\n\n# Using short form with space\ncbzconverter optimize [folder] -f webp\n\n# Using equals syntax\ncbzconverter optimize [folder] --format=webp\n\n# Format is case-insensitive\ncbzconverter optimize [folder] --format WEBP\n```\n\nWith timeout to avoid hanging on problematic chapters:\n\n```sh\ncbzconverter optimize [folder] --timeout 10m --quality 85\n```\n\nOr with Docker:\n\n```sh\ndocker run -v /path/to/comics:/comics ghcr.io/belphemur/cbzoptimizer:latest optimize /comics --quality 85 --parallelism 2 --override --format webp --split\n```\n\n#### Watch Command\n\nWatch a folder for new CBZ/CBR files and optimize them automatically:\n\n```sh\ncbzconverter watch [folder] --quality 85 --override --format webp --split\n```\n\nOr with Docker:\n\n```sh\ndocker run -v /path/to/comics:/comics ghcr.io/belphemur/cbzoptimizer:latest watch /comics --quality 85 --override --format webp --split\n```\n\n### Flags\n\n- `--quality`, `-q`: Quality for conversion (0-100). Default is 85.\n- `--parallelism`, `-n`: Number of chapters to convert in parallel. Default is 2.\n- `--override`, `-o`: Override the original files. For CBZ files, overwrites the original. For CBR files, deletes the original CBR and creates a new CBZ. Default is false.\n- `--split`, `-s`: Split long pages into smaller chunks. Default is false.\n- `--format`, `-f`: Format to convert the images to (currently supports: webp). Default is webp.\n  - Can be specified as: `--format webp`, `-f webp`, or `--format=webp`\n  - Case-insensitive: `webp`, `WEBP`, and `WebP` are all valid\n- `--timeout`, `-t`: Maximum time allowed for converting a single chapter (e.g., 30s, 5m, 1h). 0 means no timeout. Default is 0.\n- `--log`, `-l`: Set log level; can be 'panic', 'fatal', 'error', 'warn', 'info', 'debug', or 'trace'. Default is info.\n\n## Logging\n\nCBZOptimizer uses structured logging with [zerolog](https://github.com/rs/zerolog) for consistent and performant logging output.\n\n### Log Levels\n\nYou can control the verbosity of logging using either command-line flags or environment variables:\n\n**Command Line:**\n\n```sh\n# Set log level to debug for detailed output\ncbzconverter --log debug optimize [folder]\n\n# Set log level to error for minimal output\ncbzconverter --log error optimize [folder]\n```\n\n**Environment Variable:**\n\n```sh\n# Set log level via environment variable\nLOG_LEVEL=debug cbzconverter optimize [folder]\n```\n\n**Docker:**\n\n```sh\n# Set log level via environment variable in Docker\ndocker run -e LOG_LEVEL=debug -v /path/to/comics:/comics ghcr.io/belphemur/cbzoptimizer:latest optimize /comics\n```\n\n### Available Log Levels\n\n- `panic`: Logs panic level messages and above\n- `fatal`: Logs fatal level messages and above\n- `error`: Logs error level messages and above\n- `warn`: Logs warning level messages and above\n- `info`: Logs info level messages and above (default)\n- `debug`: Logs debug level messages and above\n- `trace`: Logs all messages including trace level\n\n### Examples\n\n```sh\n# Default info level logging\ncbzconverter optimize comics/\n\n# Debug level for troubleshooting\ncbzconverter --log debug optimize comics/\n\n# Quiet operation (only errors and above)\ncbzconverter --log error optimize comics/\n\n# Using environment variable\nLOG_LEVEL=warn cbzconverter optimize comics/\n\n# Docker with debug logging\ndocker run -e LOG_LEVEL=debug -v /path/to/comics:/comics ghcr.io/belphemur/cbzoptimizer:latest optimize /comics\n```\n\n## Docker Image\n\nThe official Docker image is available at: `ghcr.io/belphemur/cbzoptimizer:latest`\n\n### Docker Compose\n\nYou can use Docker Compose to run CBZOptimizer with persistent configuration. Create a `docker-compose.yml` file:\n\n```yaml\nversion: '3.8'\n\nservices:\n  cbzoptimizer:\n    image: ghcr.io/belphemur/cbzoptimizer:latest\n    container_name: cbzoptimizer\n    environment:\n      # Set log level (panic, fatal, error, warn, info, debug, trace)\n      - LOG_LEVEL=info\n      # User and Group ID for file permissions\n      - PUID=99\n      - PGID=100\n    volumes:\n      # Mount your comics directory\n      - /path/to/your/comics:/comics\n      # Optional: Mount a config directory for persistent settings\n      - ./config:/config\n    # Example: Optimize all comics in the /comics directory\n    command: optimize /comics --quality 85 --parallelism 2 --override --format webp --split\n    restart: unless-stopped\n```\n\nFor watch mode, you can create a separate service:\n\n```yaml\n  cbzoptimizer-watch:\n    image: ghcr.io/belphemur/cbzoptimizer:latest\n    container_name: cbzoptimizer-watch\n    environment:\n      - LOG_LEVEL=info\n      - PUID=99\n      - PGID=100\n    volumes:\n      - /path/to/watch/directory:/watch\n      - ./config:/config\n    # Watch for new files and automatically optimize them\n    command: watch /watch --quality 85 --override --format webp --split\n    restart: unless-stopped\n```\n\n**Important Notes:**\n- Replace `/path/to/your/comics` and `/path/to/watch/directory` with your actual directory paths\n- The `PUID` and `PGID` environment variables control file permissions (default: 99/100)\n- The `LOG_LEVEL` environment variable sets the logging verbosity\n- For one-time optimization, remove the `restart: unless-stopped` line\n- Watch mode only works on Linux systems\n\n#### Running with Docker Compose\n\n```sh\n# Start the service (one-time optimization)\ndocker-compose up cbzoptimizer\n\n# Start in detached mode\ndocker-compose up -d cbzoptimizer\n\n# Start watch mode service\ndocker-compose up -d cbzoptimizer-watch\n\n# View logs\ndocker-compose logs -f cbzoptimizer\n\n# Stop services\ndocker-compose down\n```\n\n## Troubleshooting\n\nIf you encounter issues:\n\n1. Use `--log debug` for detailed logging output\n2. Check that all required dependencies are installed\n3. Ensure proper file permissions for input/output directories\n4. For Docker usage, verify volume mounts are correct\n\n## Support\n\nFor issues and questions, please use [GitHub Issues](https://github.com/belphemur/CBZOptimizer/issues).\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelphemur%2Fcbzoptimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbelphemur%2Fcbzoptimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelphemur%2Fcbzoptimizer/lists"}