From 9fdd813bbcbfb9f870e787427a52a5a541240788 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Wed, 16 Apr 2025 15:07:59 +0200 Subject: edit: support SCALE when compressing/dithering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- edit.mk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/edit.mk b/edit.mk index 48f6856..a9fa934 100644 --- a/edit.mk +++ b/edit.mk @@ -12,6 +12,10 @@ change: .PHONY: commit edit change +IN ?= +OUT ?= +SCALE ?= x400 + compress: # => https://kokorobot.ca/site/image_optimization.html magick $(IN) \ @@ -19,13 +23,20 @@ compress: -strip \ -quality 85 \ -interlace line \ + -scale $(SCALE) \ $(OUT) # -colorspace sRGB \ dither: # => https://legacy.imagemagick.org/Usage/quantize/#ordered-dither magick $(IN) \ - -ordered-dither o8x8 \ + -sampling-factor 4:2:0 \ + -strip \ + -quality 85 \ + -interlace line \ + -ordered-dither o3x3 \ + -scale $(SCALE) \ $(OUT) + # -colorspace Gray \ .PHONY: compress dither -- cgit 1.4.1