Skip to content

Instantly share code, notes, and snippets.

@owulveryck
Last active May 26, 2021 15:47
Show Gist options
  • Save owulveryck/6b6c1218a9ca6cee4d0535c2dbfca6ec to your computer and use it in GitHub Desktop.
Save owulveryck/6b6c1218a9ca6cee4d0535c2dbfca6ec to your computer and use it in GitHub Desktop.
convert all pictures from the jpg directory into webp
SOURCE_DIR := jpg
OUTPUT_DIR := webp
jpg_srcs := $(shell find $(SOURCE_DIR) -type f -name '*.jpg')
webp := $(patsubst $(SOURCE_DIR)/%.jpg, $(OUTPUT_DIR)/%.webp, $(jpg_srcs))
toWebo: $(webp)
$(OUTPUT_DIR)/%.webp : $(SOURCE_DIR)/%.jpg
magick $< -quality 50 -define webp:lossless=true $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment