Adds a note for an imagemagick command that resizes and optimizes.
This commit is contained in:
@@ -11,3 +11,11 @@ Here's a small collection of various utilities and recipes I find useful. It's n
|
|||||||
```bash
|
```bash
|
||||||
nix run 'nixpkgs#jpegoptim' -- --max=85 --strip-all *.jpg
|
nix run 'nixpkgs#jpegoptim' -- --max=85 --strip-all *.jpg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The major issue with `jpegoptim` is that it doesn't do resizing. Image Magick is the Swiss army knife of image manipulation and can do it all, but it's a much larger piece of software. This can quickly reduce a full-size camera image (~5MB) to something suitable for web uploads, thumbnails or avatars (50kB).
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix run 'nixpkgs#imagemagick' -- input.jpg -resize 1200x800 -strip -quality 85 output.jpg
|
||||||
|
```
|
||||||
|
|
||||||
|
There are lots of options that can be passed to the [image geometry](https://imagemagick.org/command-line-processing/#geometry). The default for pixel sizes is to treat it as a maximum and preserve the aspect ratio. If only a width is given then height is automatically determined from the aspect ratio.
|
||||||
|
|||||||
Reference in New Issue
Block a user