resize
|
After Width: | Height: | Size: 134 KiB |
|
After Width: | Height: | Size: 224 KiB |
|
After Width: | Height: | Size: 259 KiB |
|
After Width: | Height: | Size: 128 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 257 KiB |
|
After Width: | Height: | Size: 227 KiB |
|
After Width: | Height: | Size: 442 KiB |
|
After Width: | Height: | Size: 268 KiB |
|
After Width: | Height: | Size: 224 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 219 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 193 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 146 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 314 KiB |
|
After Width: | Height: | Size: 311 KiB |
|
After Width: | Height: | Size: 163 KiB |
|
After Width: | Height: | Size: 145 KiB |
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 111 KiB |
|
After Width: | Height: | Size: 134 KiB |
|
After Width: | Height: | Size: 235 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 258 KiB |
|
After Width: | Height: | Size: 331 KiB |
|
After Width: | Height: | Size: 304 KiB |
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 192 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 2.2 MiB |
@@ -0,0 +1,61 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if ! command -v magick &> /dev/null; then
|
||||||
|
echo "ImageMagick (magick) is required. Install it first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p bg blog
|
||||||
|
|
||||||
|
# Final exact dimensions (not just width anymore)
|
||||||
|
BG_WIDTH=1920
|
||||||
|
BG_HEIGHT=1080 # Hero (16:9)
|
||||||
|
|
||||||
|
BLOG_WIDTH=800
|
||||||
|
BLOG_HEIGHT=600 # 3-column cards (4:3 is a safe default)
|
||||||
|
|
||||||
|
# Quality
|
||||||
|
BG_QUALITY=82
|
||||||
|
BLOG_QUALITY=75
|
||||||
|
|
||||||
|
echo "Converting JPG → WebP with fixed dimensions + center crop..."
|
||||||
|
|
||||||
|
for img in *.jpg *.jpeg; do
|
||||||
|
[ -e "$img" ] || continue
|
||||||
|
|
||||||
|
filename=$(basename "$img")
|
||||||
|
name="${filename%.*}"
|
||||||
|
|
||||||
|
echo "→ Processing $img"
|
||||||
|
|
||||||
|
# HERO / BG (cover + center crop)
|
||||||
|
magick "$img" \
|
||||||
|
-resize ${BG_WIDTH}x${BG_HEIGHT}^ \
|
||||||
|
-gravity center \
|
||||||
|
-extent ${BG_WIDTH}x${BG_HEIGHT} \
|
||||||
|
-strip \
|
||||||
|
-quality $BG_QUALITY \
|
||||||
|
-define webp:method=6 \
|
||||||
|
-define webp:autofilter=true \
|
||||||
|
-define webp:thread-level=1 \
|
||||||
|
-colorspace sRGB \
|
||||||
|
"bg/${name}.webp"
|
||||||
|
|
||||||
|
# BLOG (cover + center crop)
|
||||||
|
magick "$img" \
|
||||||
|
-resize ${BLOG_WIDTH}x${BLOG_HEIGHT}^ \
|
||||||
|
-gravity center \
|
||||||
|
-extent ${BLOG_WIDTH}x${BLOG_HEIGHT} \
|
||||||
|
-strip \
|
||||||
|
-quality $BLOG_QUALITY \
|
||||||
|
-define webp:method=6 \
|
||||||
|
-define webp:autofilter=true \
|
||||||
|
-define webp:thread-level=1 \
|
||||||
|
-colorspace sRGB \
|
||||||
|
"blog/${name}.webp"
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Done! Images cropped + standardized in ./bg and ./blog"
|
||||||