{"id":20266345,"url":"https://github.com/ivanbgd/reduce-image-size-rust","last_synced_at":"2026-06-11T07:31:14.076Z","repository":{"id":211465903,"uuid":"729190913","full_name":"ivanbgd/reduce-image-size-rust","owner":"ivanbgd","description":" Reduces size of images in a folder","archived":false,"fork":false,"pushed_at":"2025-10-18T14:11:22.000Z","size":157,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-18T21:32:10.268Z","etag":null,"topics":["image","images","photo","photos","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ivanbgd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-12-08T16:08:00.000Z","updated_at":"2025-10-18T14:11:25.000Z","dependencies_parsed_at":"2025-09-28T15:29:16.227Z","dependency_job_id":"b32db1fa-f8f0-4381-aa06-0d5b22bb390a","html_url":"https://github.com/ivanbgd/reduce-image-size-rust","commit_stats":null,"previous_names":["ivanbgd/reduce-image-size-rust"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ivanbgd/reduce-image-size-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Freduce-image-size-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Freduce-image-size-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Freduce-image-size-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Freduce-image-size-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanbgd","download_url":"https://codeload.github.com/ivanbgd/reduce-image-size-rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanbgd%2Freduce-image-size-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34188272,"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-11T02:00:06.485Z","response_time":57,"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":["image","images","photo","photos","rust","rust-lang"],"created_at":"2024-11-14T12:08:48.449Z","updated_at":"2026-06-11T07:31:14.070Z","avatar_url":"https://github.com/ivanbgd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reduce Image Size\n\n[![license](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](LICENSE)\n[![crates.io](https://img.shields.io/crates/v/reduce_image_size.svg)][crates.io link]\n[![downloads](https://img.shields.io/crates/d/reduce_image_size.svg)][crates.io link]  \n[![docs.rs](https://docs.rs/reduce_image_size/badge.svg)](https://docs.rs/reduce_image_size/)\n[![CI](https://github.com/ivanbgd/reduce-image-size-rust/actions/workflows/ci.yml/badge.svg)](https://github.com/ivanbgd/reduce-image-size-rust/actions/workflows/ci.yml)\n[![Security audit](https://github.com/ivanbgd/reduce-image-size-rust/actions/workflows/audit.yml/badge.svg)](https://github.com/ivanbgd/reduce-image-size-rust/actions/workflows/audit.yml)  \n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)\n\n[crates.io link]: https://crates.io/crates/reduce_image_size\n\n## Description\nReduces size of images in a folder (and optionally sub-folders, recursively).\n\nThis is useful for archiving of photos, for example, as they look the same on a display even with a reduced file size.  \nThis application reduces file sizes of images in bulk.\n\nSupports JPEG and PNG image formats, with the following file extensions (case-insensitive): `jpg`, `jpeg`, `png`.\n\nSupports Windows, macOS on Apple silicon (ARM) and x86-64, and Linux on ARM and x86-64.\n\nExecutable files for Windows, macOS and Linux can be downloaded from\nthe [Releases](https://github.com/ivanbgd/reduce-image-size-rust/releases) page of the repository.\n\nBy default, keeps the original images and creates copies with reduced file size.\n\nBy default, copies the entire folder tree, with all sub-folders that exist in the source tree.  \nThe target folder tree will be created automatically,\nand the new reduced-size images will be copied properly to their respective paths.  \nIt is only required to provide the root target folder, and it will also be created if it doesn't exist.  \nNon-supported files will simply be copied to the destination.\n\nThe destination folder can be the same as the source folder, in which case the original images will be **overwritten**,\nand not retained.  \nOther, non-supported files, will be retained.\n\nIf there is enough disk space, it is advised to specify a different destination folder than the source folder,\nso that the original images can be retained and the newly-created reduced-size images can be inspected for quality.  \nA user can experiment with the `resize` and the `quality` arguments.  \nAlso, the user can go only one level deep and not recursively, or simply experiment on a copy of an image folder.  \nIf satisfied with the result, original images can be deleted afterwards easily to save disk and/or cloud space.\n\n## Options\n- Look into subdirectories recursively (process the entire tree); recommended: `-r`, `--recursive`\n- Reduce both image dimensions by half: `--resize`\n- JPEG quality, on a scale from 1 (worst) to 100 (best); the default is 75; ignored in case of PNGs:\n  `-q`, `--quality \u003cQUALITY\u003e`\n- A minimum file size for which a user would like to perform file size reduction:\n  `-s {s,m,l,S,M,L}`, `--size {s,m,l,S,M,L}`\n    - S = 100 kB, M = 500 kB, L = 1 MB\n    - Files that are smaller than the designated size will simply be copied to the destination folder.\n    - If this option is left out, then all files are considered for size reduction; i.e., minimal considered size is 0.\n\n### Examples\nSee below for how to prepare the application for running.  \nThe file paths in the examples are for Windows.\n- `reduce_image_size D:\\img_src D:\\img_dst`\n- `reduce_image_size D:\\img_src D:\\img_dst -r`\n- `reduce_image_size D:\\img_src D:\\img_dst -r -s m`\n- `reduce_image_size D:\\img_src D:\\img_dst --recursive --size L`\n- `reduce_image_size D:\\img_src D:\\img_dst -r --resize -q 60 -s l`\n- `reduce_image_size D:\\img_src D:\\img_dst --recursive --resize --quality 60 --size L`\n\n## Notes\n- Updated and tested in Rust 1.89.0 and 1.90.0 on Apple silicon with macOS Sequoia 15.3.2.\n- First developed in Rust 1.74.1, but also tested later with Rust 1.79.0.\n- Tested on x86-64 CPUs on Windows 10 and Windows 11.\n- Tested on Apple silicon, M2 Pro, on macOS Sonoma 14.5.\n- Also tested on WSL - Ubuntu 22.04.2 LTS (GNU/Linux 5.15.133.1-microsoft-standard-WSL2 x86_64) on Windows 11 @ x86-64.\n- Linux wasn't tested directly, but should work, at least on x86-64 CPUs.\n\n## Security\n\n- [cargo audit](https://github.com/rustsec/rustsec/blob/main/cargo-audit/README.md) is supported,\n  as well as its GitHub action, [audit-check](https://github.com/rustsec/audit-check).\n- [cargo deny](https://embarkstudios.github.io/cargo-deny/) is supported,\n  as well as its GitHub action, [cargo-deny-action](https://github.com/EmbarkStudios/cargo-deny-action).\n\n## Development\n\n### Pre-commit\n\n[pre-commit](https://pre-commit.com/) hooks are supported.\n\n```shell\n$ pip install pre-commit  # If you don't already have pre-commit installed on your machine. Run once.\n$ pre-commit autoupdate  # Update hook repositories to the latest versions.\n$ pre-commit install  # Sets up the pre-commit git hook script for the repository. Run once.\n$ pre-commit install --hook-type pre-push  # Sets up the pre-push git hook script for the repository. Run once.\n$ pre-commit run  # For manual running; considers only modified files.\n$ pre-commit run --all-files  # For manual running; considers all files.\n```\n\nAfter installing it, the provided [pre-commit hook(s)](.pre-commit-config.yaml) will run automatically on `git commit`.\n\n## Running the Application\nExecutable files for Windows, macOS and Linux can be downloaded from\nthe [Releases](https://github.com/ivanbgd/reduce-image-size-rust/releases) page of the repository.\n\nUse the latest release version.\n\nDownload the appropriate archive for your OS and unpack it to a desired folder.\n\nThe archive files contain an executable.\n\nAfter unpacking the archive, go to the directory with the executable and run the program as:  \n\n```shell\nreduce_image_size \u003csource_folder\u003e \u003cdestination_folder\u003e [options]\n```\n\nOr, provide full path to the program.\n\nPaths to the source and destination folders can be absolute or relative.\n\n## Building the Application and Running it With cargo\nThis section applies in case you don't have an executable and need to build it.\n\nIt may depend on the OS. Namely, while installation of `nasm` is needed on Windows, it is not needed on macOS.\n`nasm` doesn't support Apple silicon, but this crate works on macOS Sonoma 14.5 on Apple M2 Pro processor.\nLinux hasn't been tested. Also, macOS on x86 architecture hasn't been tested.\n\nThe library and the application require:\n- [CMake](https://cmake.org/download/)\n- [nasm](https://www.nasm.us/), on Windows\n\nAdd `CMake` to the `PATH` environment variable.\n\nMake sure to build the application in `release` mode as it will run much faster that way.\n\nBuild:\n```shell\ncargo build --release\n```\n\nRun:\n```shell\ncargo run --release -- \u003csource_folder\u003e \u003cdestination_folder\u003e [options]\n```\n\n## Library\nThis Rust crate was originally meant as a binary (executable) crate, i.e., an application,\nbut it was later decided to publish the library part, so it can be used as a Rust library, too.\n\nOnly the main image-processing function, `process_images`, has been made public.\n\nHelper functions have been made private.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanbgd%2Freduce-image-size-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanbgd%2Freduce-image-size-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanbgd%2Freduce-image-size-rust/lists"}