Browse Source

Updating README for new image optimization information

master
Mobius K 10 months ago
parent
commit
4189dfc07e
  1. 24
      README.md

24
README.md

@ -19,23 +19,7 @@ git submodule update --init pixelle
## Image optimization
There are generally three copies of any given gallery image:
1. Source that should never be altered for possible future transformations, resizing, crops, etc.
2. WEBP for modern lossy image display
3. PNG or JPG fallback for older clients
Four possible scripts make image optimization easy:
```bash
# Resize an image that is too large with ImageMagick by width, or by height, respectively
convert path/to/file -resize 200 path/to/destination
convert path/to/file -resize x100 path/to/destination
# Convert any image to a WEBP
cwebp -q 90 path/to/file -o path/to/destination.webp
# Quantize PNG images
pngquant --output path/to/destination.png -- path/to/file
# Optimize JPG images
jpegoptim -m 90 path/to/file --stdout > path/to/destination.jpg
```
Images run through a process to be optimized for the website:
1. Add source to assets directory
2. Hugo will resize it as needed at build time (this takes awhile on the first run to populate the resources folder)
3. Parent project's shell script runs pngquant, optipng, jpegoptim, and cwebp as needed for release builds
Loading…
Cancel
Save