Skip to content

About

An Image Optimizer App for Windows

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

3 stars

Watchers

1 watching

Forks

Image Optimizer

Build Lint Latest release Downloads OpenSSF Scorecard License: MIT

A lightweight, fast, lossless image optimizer for Windows, inspired by ImageOptim on the Mac.

Drop AVIF, GIF, JPEG, JPEG XL, PNG, SVG and WebP files (or whole folders) onto the window. Each file is optimized and replaced in place. There's nothing to configure: the defaults are safe, and a small Settings panel (gear button) is there if you want it.

You can also right-click images or folders in File Explorer and choose Optimize with Image Optimizer. Selecting many files at once opens them all in one window.

Click the File, Size or Savings header to sort the list (click again to reverse it). The app follows the Windows light or dark app mode automatically, and uses your High Contrast colors when a contrast theme is on. It's in English, French, German, Italian, Japanese and Spanish, and follows the Windows display language.

Light Dark
Image Optimizer in light mode Image Optimizer in dark mode

How it stays lossless and safe

  1. The original is copied to a private temporary folder; the optimizers only ever see that copy.
  2. The format's optimizer writes one or more candidates (for JPEG, both baseline and progressive).
  3. Candidates that aren't strictly smaller than the original are thrown away.
  4. The smallest candidate is decoded and compared pixel by pixel with the original (Windows imaging for PNG/JPEG, dwebp for WebP, avifdec for AVIF, djxl for JPEG XL, and every frame of a GIF as browsers draw it, along with its timing and loop count). Any difference and it's discarded.
  5. If the file changed on disk in the meantime, nothing is written.
  6. Only then is the original swapped for the candidate in a single File.Replace step.

If anything fails along the way, the original file is left exactly as it was.

Format Tool What it does
AVIF avifenc / avifdec from libavif Lossless AVIFs are re-encoded losslessly at a higher effort (typically a few percent smaller). Lossy AVIFs are left untouched.
GIF Gifsicle -O3 lossless frame and LZW optimization. Removing metadata also drops other programs' data, such as XMP, unless the GIF has a color profile.
JPEG jpegtran from libjpeg-turbo Optimized Huffman tables and progressive encoding, without touching the image data.
JPEG XL cjxl / djxl from libjxl Lossless JPEG XLs are re-encoded losslessly at a higher effort (typically a few percent smaller). Recompressed JPEGs are rebuilt and recompressed, and still turn back into the exact original JPEG. Lossy, animated and rotated JPEG XLs are left untouched.
PNG oxipng Lossless filter, bit depth, palette and deflate optimization. Animated PNGs are left untouched.
SVG SVGO SVGO's default preset, run in the built-in Jint engine (no Node.js needed). SVGs are text, so they aren't pixel-compared.
WebP cwebp / webpmux from libwebp Lossless WebPs are re-encoded losslessly. Lossy WebPs are never re-encoded, only stripped of metadata.

By default metadata (EXIF, comments, camera info) is removed, but color profiles and JPEG orientation are always kept so images look exactly the same.

Settings

  • Formats to optimize (AVIF, GIF, JPEG, JPEG XL, PNG, SVG, WebP)
  • Remove metadata (on by default)
  • Maximum compression: Zopfli for PNG, maximum effort for WebP, AVIF and JPEG XL, multipass SVGO (off by default; much slower)
  • Use progressive JPEG when it's smaller (on by default)
  • Keep each file's original "Date modified" (on by default)
  • Add "Optimize with Image Optimizer" to File Explorer's right-click menu (on by default)

Settings are stored in %AppData%\ImageOptimizer\settings.json.

Install

Get it from the Microsoft Store. The Store keeps it up to date, and uninstalling it from Windows Settings > Apps removes everything, including the File Explorer entry.

Requires Windows 10 (version 2004 or later) or Windows 11, x64.

If you installed an earlier version with ImageOptimizer-win-Setup.exe, uninstall that from Windows Settings > Apps too. It no longer receives updates.

If your antivirus blocks it

The app rewrites many image files in quick succession and runs bundled command-line tools, which some antivirus behavior checks mistake for ransomware. If yours blocks or closes it, report the false positive to the vendor (for Trend Micro, submit the file for analysis; on a work PC, ask your IT team).

Releasing

Bump <Version> in Directory.Build.props, then open Actions > Publish > Run workflow. It uses that version (or the one you type in), tags the commit vX.Y.Z, builds and tests it, packs the Microsoft Store package (ImageOptimizer-X.Y.Z-x64.msix, made by scripts/pack-msix.ps1) and attaches it to a GitHub Release. Pushing a vX.Y.Z tag yourself does the same.

Then, in Partner Center, start a new submission for Image Optimizer, upload the .msix under Packages and submit it. The Store signs it, and once it passes certification everyone's copy updates itself.

After publishing, the VirusTotal workflow uploads the package and the app's own exe and DLLs to VirusTotal and lists any antivirus engines that flag them in the run summary, so false positives show up before people hit them. It needs a free VirusTotal API key saved as the VIRUSTOTAL_API_KEY repository secret (without one it skips the scan), and it never fails a release. To scan an earlier release, open Actions > VirusTotal > Run workflow.

Building

./scripts/fetch-tools.ps1          # downloads the pinned optimizer binaries into ./tools
dotnet build ImageOptimizer.sln
dotnet test --solution ImageOptimizer.sln
dotnet publish src/ImageOptimizer.App -c Release -r win-x64 --self-contained true -o publish
./scripts/pack-msix.ps1 -Version 1.2.3 -Register  # optional: packs and installs it (needs Developer Mode)

Every push is built and tested on Windows by GitHub Actions, and the ready-to-run app and its Store package are attached to the workflow run as the ImageOptimizer-win-x64 and ImageOptimizer-msix artifacts.

The File Explorer entry (src/ImageOptimizer.ShellMenu) is a small C++ COM DLL that only works inside the MSIX package; pack-msix.ps1 builds it with CMake and Visual Studio's C++ tools.

The engine (src/ImageOptimizer.Core) is cross-platform, so its tests also run on Linux or macOS with oxipng, jpegtran, cwebp/dwebp/webpmux, avifenc/avifdec, cjxl/djxl and gifsicle on the PATH.

The tests include FsCheck property tests (PropertyTests.cs) that fuzz the engine with random and damaged images, checking that nothing crashes and that a file is only ever replaced by a smaller, verified copy.

License

Image Optimizer is released under the MIT License. The bundled tools keep their own licenses; see THIRD-PARTY-NOTICES.md.

About

An Image Optimizer App for Windows

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

3 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages