High-Res Artwork Management Automation

The iPhone4 comes with a super high-res display and to leverage that encourages App Developers to provide all artwork twofold – once „normal“ and once in double resolution named equally with a „@2x“ suffix.

To ease my designers‘ life and avoid confusion (and designers are easily confused I found) I ask them to provide the high-res artwork only and I scale it down myself. And as this is a reoccuring task, I automated via a Makefile like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/make
# Make help: http://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
 
# Requires ImageMagick, Installation per macport: $ sudo port install imagemagick +no_x11
CONVERT	:=	convert
 
# Where are the images?
ASSETS_DIR := .
 
# Which ones? All @2x.png plus twins without @2x.png
ASSETS_HIGH	:=	$(wildcard $(ASSETS_DIR)/*@2x.png)
ASSETS_LOW	:=	$(patsubst %@2x.png,%.png,$(ASSETS_HIGH))
 
# The scaling command
%.png: %@2x.png
	convert $< -resize 50% $@
 
assets: $(ASSETS_LOW)
 
clean:
	-rm $(ASSETS_LOW)

See also my link collection about high-res images and my general Xcode project setup.

Flattr this!

Post a Comment

Your email is never published nor shared. Required fields are marked *