# Smash It

> Smash It is a free, open source Windows app that makes images, videos and PDFs smaller. Drop files or folders on its window, or right-click them in the File Explorer: Smash It tries every engine that can handle each file, keeps the smallest result, and only keeps it when it really got smaller. By default it is lossless and keeps your originals.

- Web page: https://geoffreycrofte.com/project/smash-it/ (French: https://geoffreycrofte.com/fr/projet/smash-it/)
- Source code: https://github.com/geoffreycrofte/smash-it (GPL-3.0-or-later)
- Made by Geoffrey Crofte, Crofte Studio: https://geoffreycrofte.com/

## Download

Windows 10 (version 1809 or later) or Windows 11, 64-bit. Nothing else to install: the runtime and every compression tool ship with the app. In English and French.

- Installer: https://github.com/geoffreycrofte/smash-it/releases/latest/download/SmashIt-Setup-x64.exe
  Installs for the current user only, without admin rights. Options: the "Compress with Smash It" right-click entry (on by default), a desktop shortcut, and the `smashit` command in the PATH.
- Portable zip: https://github.com/geoffreycrofte/smash-it/releases/latest/download/SmashIt-win-x64.zip
  Unzip anywhere and run `SmashIt.exe`. The command line is `cmd\smashit.cmd`.
- All releases: https://github.com/geoffreycrofte/smash-it/releases

The builds are not code-signed yet, so Windows SmartScreen may warn on first launch: choose "More info", then "Run anyway". Each release lists the SHA-256 of its files in `SHA256SUMS.txt`.

## What it compresses

- Images: JPEG, PNG, TIFF, BMP, JPEG XR, HEIC, GIF, SVG, WebP, AVIF. Lossless optimization with jpegtran and oxipng; lossy PNG with pngquant (often 60 to 80% smaller for screenshots and illustrations); WebP with cwebp and AVIF with avifenc.
- GIF with gifsicle, animated ones included: every frame, delay and loop setting is kept. Lossy mode adds invisible noise so the file compresses much better.
- SVG with oxvg (a port of SVGO): editor data, hidden and empty elements, default values and comments are removed, coordinates are rounded and shapes written more compactly. IDs, the `viewBox` and the title are kept. The result is only used if it is a valid SVG with the same size and `viewBox` and still draws something. Reading HEIC, WebP and AVIF needs the free HEIF, HEVC, WebP and AV1 image extensions from the Microsoft Store.
- Conversion between JPEG, PNG, WebP, AVIF, HEIC, TIFF, JPEG XR and BMP.
- Videos: MP4 in H.264 (plays everywhere) or HEVC (about 40% smaller), with the encoder built into Windows and the graphics card when available. MOV, MKV, AVI and WebM become MP4, only when that makes them smaller. Portrait phone videos come out upright. The bitrate never exceeds the source. Videos need the lossy mode. An optional maximum resolution, 1080p or 720p, brings larger videos down, never up: a 4K phone video at 1080p is typically 3 to 4 times lighter.
- PDF: the images inside are recompressed, the document is never rebuilt. Text, fonts, links, forms and bookmarks are untouched. The result must pass a validity check and keep the same number of pages. Signed and encrypted PDFs are skipped.
- PDF in lossy mode: images much finer than their size on the page are scaled down to 150 dpi (screen, the default) or 300 dpi (print). A scanned document often ends up 5 to 10 times smaller. Only plain grayscale or RGB JPEG images are resampled.

Example from the project's screenshots: eight photos with the Web preset went from 14.22 MB to 6.98 MB, 7.24 MB saved (50.9%), about half of each.

## Settings

- Lossless or lossy, quality from 1 to 100, separately for images, PDFs and videos.
- Presets: Best quality (lossless, the default), Web, Email (lightest) and Archive (lossless, metadata kept) set images, PDFs and videos in one choice; changing any setting shows "Custom".
- Effort: fast, balanced or maximum (more effort, smaller files, slower).
- Output format for images, or keep the format.
- Maximum image resolution for lossy PDFs: 150 dpi or 300 dpi.
- Remove metadata (on by default): EXIF (camera, date, GPS), XMP, IPTC and comments. The colour profile and orientation are always kept. Unticked, EXIF and XMP follow the picture, including from an iPhone HEIC, an AVIF or a WebP to a JPEG, PNG, WebP or AVIF.
- Maximum video resolution: keep, 1080p or 720p (the Web preset uses 1080p, Email 720p).
- Keep the originals (on by default), saving results next to them as `name-compressed.ext` or in a `compressed` folder under the same name. Turned off, the result replaces the original, which goes to the Recycle Bin.
- Language: automatic (follows Windows), English or French.
- Check for updates at startup (on by default), in Settings, About.
- Settings are remembered between launches.

## Windows Explorer

- Right-click images, PDFs, videos or folders and choose "Compress with Smash It".
- Works with any number of selected files: they all land in the same Smash It window, which comes to the front.
- Uses the settings last chosen in the window.
- On Windows 11, the entry is under "Show more options" (the new top-level menu only accepts packaged, signed apps).
- Turn it on or off in Settings, Windows Explorer. The entry repairs itself if the portable app was moved, and its label follows the chosen language.
- Files and folders can also be dragged onto the window, or added with the Add button.

## Your files

- With several files at once and originals kept, Smash It asks where results go (next to the originals or in a `compressed` folder), preset to the last choice, with a "Don't ask again" option.
- With the `compressed` folder, files that are already as small as they can get can be copied there too, so it holds the whole set, ready to send.
- A `compressed` folder inside a dropped folder is skipped, so results are never compressed twice.
- Existing files are never overwritten: a taken name becomes `name (2).ext`.
- Folders are searched with their subfolders. Hidden and system files are ignored.
- When originals are replaced, the swap is done so it cannot fail half-way, and the original goes to the Recycle Bin.

## Reliability

- The real format is detected from the file's content, not its extension.
- Every capable engine runs; the smallest output wins; a lossless optimizer then polishes it.
- A result that is not smaller is not kept (except a conversion you asked for).
- Lossy PNG: an image that cannot reach the quality target is left to the lossless engines rather than visibly damaged.
- Multi-page TIFFs are skipped. 16-bit images are refused in lossless mode, since they would lose precision.
- A file Smash It cannot work on, like a signed PDF, is marked "Not supported" with the reason, not "Error".

## While it works

- Several files are compressed at once (all processor cores but one); videos one at a time.
- Live progress in the footer: files being compressed, waiting, and space saved so far.
- "Stop" ends a batch: files not compressed yet stay as they are.
- "Recompress" runs the whole list again with the current settings.
- Before and after view for every compressed image: double-click a row, press Enter, or use the compare button. Drag the split, click anywhere, or use the arrow keys (Shift for finer steps); "100 %" or Z shows the images pixel for pixel; double-click recentres; Esc closes. It still works after the original went to the Recycle Bin.

## Command line

```
smashit [options] <files or folders…>

  --lossless           Lossless only (default)
  --lossy              Allow quality loss
  -q, --quality <n>    Quality 1–100 (implies --lossy)
  -t, --to <format>    Convert to jpg, png, webp, avif, heic, tif, jxr, bmp
  -e, --effort <n>     fast, balanced (default) or max
  --codec <codec>      Video: h264 (default) or hevc; needs --lossy or -q
  --keep               Keep the original, write "name-compressed.ext" next to it
  --folder             Keep the original, write the result into a "compressed" folder next to it
  --copy-all           Like --folder, and also copy the files that are already optimal
  --pdf-dpi <n>        Lossy PDFs: scale images down to n dpi at most (default 150, 0 keeps them)
  --video-max <n>      Videos: bring the short side down to n pixels, e.g. 1080 or 720 (default: keep)
  --no-recycle         Delete the original instead of using the Recycle Bin
  --keep-metadata      Keep EXIF, XMP, IPTC and comments
  --strip-metadata     Remove them (default; color profile and orientation are kept)
```

By default, the command line replaces the originals and sends them to the Recycle Bin, unlike the window. To keep them, add `--keep` or `--folder`. The command prints each result and a total. Ctrl+C stops cleanly. Exit codes: 0 done, 1 wrong usage or no file found, 2 at least one file failed.

## Updates

At startup, Smash It asks GitHub for the list of published releases (nothing else is sent: no identifier, no statistics) and shows a banner when a newer version is out, with what's new. With the installer, "Update" downloads the new installer, checks it against the release's `SHA256SUMS.txt`, installs it and restarts the app, settings kept. The portable build links to the download instead. The check can be turned off, or run on demand, in Settings, About. What changed in each version: https://github.com/geoffreycrofte/smash-it/blob/main/CHANGELOG.md

## Privacy

Your files never leave the computer: no account, no upload. The only network request is the update check above, which can be turned off.

## Accessibility

Smash It uses standard Windows controls and works with the keyboard and screen readers: Add opens a file picker, the arrow keys move through the file list, every icon button has a name, and the before and after view works from the keyboard. Accessibility statement, with what has not been checked yet: https://github.com/geoffreycrofte/smash-it/blob/main/ACCESSIBILITY.md

## Roadmap

Coming next: audio compression, a Mac version, format conversion tools.

Done since the first versions: presets (Web, Email, Archive), zoom to 100 % in the before and after view, finer video settings, metadata kept for more formats, settings for each engine.
