{"id":35020490,"url":"https://github.com/bfalls/img-compressor","last_synced_at":"2026-04-20T20:36:13.054Z","repository":{"id":324134955,"uuid":"1092616603","full_name":"bfalls/img-compressor","owner":"bfalls","description":"GPU-accelerated JPEG compressor","archived":false,"fork":false,"pushed_at":"2025-12-27T03:45:28.000Z","size":4753,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-28T19:48:58.511Z","etag":null,"topics":["cli-tool","command-line","compression","cpp","cpp-cuda-gpu-programming-parallel-computing","cuda","dct","demo-project","gpgpu","gpu-programming","high-performance-computing","hpc","image-compression","image-processing","jpeg","parallel-computing"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bfalls.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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-11-09T00:41:20.000Z","updated_at":"2025-12-27T03:45:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bfalls/img-compressor","commit_stats":null,"previous_names":["bfalls/img-compressor"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bfalls/img-compressor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfalls%2Fimg-compressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfalls%2Fimg-compressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfalls%2Fimg-compressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfalls%2Fimg-compressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfalls","download_url":"https://codeload.github.com/bfalls/img-compressor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfalls%2Fimg-compressor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32065113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["cli-tool","command-line","compression","cpp","cpp-cuda-gpu-programming-parallel-computing","cuda","dct","demo-project","gpgpu","gpu-programming","high-performance-computing","hpc","image-compression","image-processing","jpeg","parallel-computing"],"created_at":"2025-12-27T05:51:09.050Z","updated_at":"2026-04-20T20:36:13.049Z","avatar_url":"https://github.com/bfalls.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg\n    src=\"assets/branding/img-compressor-hero.png\"\n    alt=\"img-compressor - GPU-accelerated image compression with content-aware quality mapping\"\n    width=\"1200\"\n  /\u003e\n\u003c/p\u003e\n\n# img-compressor\n\nA high-performance GPU-accelerated JPEG compressor written in C++ and CUDA.  \nThe tool supports both CPU and GPU paths for comparing compression performance and output quality.\n\nIn addition to standard quality-based compression, the tool supports **content-aware quality mapping**, which preserves visual detail in perceptually important regions while applying stronger compression elsewhere. Optional debug outputs make it easy to inspect and verify how quality is distributed across the image.\n\nThis utility demonstrates efficient RGB image compression using CUDA kernels and a custom JPEG scanline writer, \nwith optional CPU comparison for benchmarking and verification.\n\n---\n\n## Features\n\n- GPU-accelerated image compression (CUDA)\n- Optional CPU comparison mode (`--compare`)\n- Quality control with `--quality` parameter\n- Content-aware quality mapping with visual debug outputs\n- Simple CLI tool\n\n---\n\n## Requirements\n\n- **Visual Studio 2022** with Desktop Development for C++\n- **CUDA Toolkit 13.0** or later\n- **vcpkg** (for dependency management)\n\n---\n\n## Download\n\n**Prebuilt binaries available on the\n[Releases page](https://github.com/bfalls/img-compressor/releases)**\n\nSupports:\n- Windows (x64)\n\n## Build Instructions (Visual Studio)\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/bfalls/img-compressor.git\n   cd img-compressor\n   ```\n\n2. Make sure you have vcpkg installed and integrated with Visual Studio:\n    ```bash\n    C:\\vcpkg\\vcpkg integrate install\n    ```\n\n3. Open img-compressor.sln in Visual Studio.\n\n4. Select the desired configuration:\n   Debug x64 (default for development)\n   Release x64 (optimized for speed)\n\n5. Build the project (Ctrl+Shift+B or Build -\u003e Build Solution).\n  \n6. Or build on the command line:\n   ```powershell\n   msbuild img-compressor.sln \"/t:Clean;Build\" /p:Configuration=Debug /p:Platform=x64 /m /verbosity:minimal\n   msbuild img-compressor.sln \"/t:Clean;Build\" /p:Configuration=Release /p:Platform=x64 /m /verbosity:minimal\n   ```\n\n7. A sample image is included under tests\\data\\img-test.png.\n   Run the compressor from the project root after building:\n   ```powershell\n    .\\x64\\Debug\\img-compressor.exe --input tests\\data\\img-test.png --output tests\\artifacts\\out.jpg --quality 85 --compare\n   ```\n\n   If you don't have a GPU it will just use the CPU path.\n   See the timings comparison and don't forget to view the images.\n   Try different quality settings!\n\n   ```shell\n   [GPU] wrote .\\tests\\artifacts\\out-gpu.jpg in 19.855 ms\n   [CPU] wrote .\\tests\\artifacts\\out-cpu.jpg in 402.399 ms\n   ```\n\n### Quick demos\n\n**Baseline (no quality map):**\n\n```powershell\n.\\x64\\Debug\\img-compressor.exe --input tests\\data\\img-test.png --output tests\\artifacts\\out.jpg --quality 85 --compare\n```\n\nThis runs GPU (if available) and CPU, writing `out-gpu.jpg` / `out-cpu.jpg` plus a timing/size table.\n\n**Content-aware quality map (with debug outputs):**\n\n```powershell\n.\\x64\\Debug\\img-compressor.exe --input tests\\data\\img-test.png --output tests\\artifacts\\out.jpg --quality 85 --compare --quality-map --quality-map-debug tests\\artifacts\n```\n\nFlags of interest:\n- `--quality-map`: enable saliency-based, per-block coefficient scaling.\n- `--quality-map-strength \u003c0..1\u003e`: blend amount (default `0.6`).\n- `--quality-map-min-scale` / `--quality-map-max-scale`: bounds for per-block scaling (defaults `0.7` / `1.6`).\n- `--quality-map-debug \u003cdir\u003e`: writes `importance_heatmap.pgm` and `block_map.csv` to the directory you provide. When combining `--compare` + `--quality-map`, debug artifacts auto-drop next to the output if you omit this flag.\n\nThe quality-map run outputs GPU/CPU JPEGs (with `-gpu`/`-cpu` suffixes), a comparison table (size, time, PSNR vs GPU when applicable), and the saliency heatmap/CSV for inspection.\n\n   [![Hits](https://hits.sh/github.com/bfalls/img-compressor.svg?style=plastic)](https://hits.sh/github.com/bfalls/img-compressor/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfalls%2Fimg-compressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfalls%2Fimg-compressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfalls%2Fimg-compressor/lists"}