SIZE := 256x256

CONVERT := $(shell command -v convert 2> /dev/null)
ifndef CONVERT
    $(error "Missing convert command. Please install 'imagemagick'")
endif

.SECONDEXPANSION:
%_$(SIZE).png: $$(wildcard $$*.*)
	convert $< -trim -resize $(SIZE) -gravity center -extent $(SIZE) -background white -alpha remove -alpha off $@

logos: $(addsuffix _$(SIZE).png,$(basename $(subst _$(SIZE),,$(wildcard */logos/*))))
