README: add imagemagick and gettext
[xcsoar.git] / build / imagemagick.mk
blob0871c3c0c775db56cc3eab8fb11114bc84d7cce0
1 IM_PREFIX :=
3 # extract alpha channel
4 %_alpha.png: %.png
5 $(Q)$(IM_PREFIX)convert $< -alpha Extract +matte +dither -colors 8 $@
7 # extract RGB channels
8 %_rgb.png: %.png
9 $(Q)$(IM_PREFIX)convert $< -background white -flatten +matte +dither -colors 64 $@
11 # tile both images
12 %_tile.png: %_alpha.png %_rgb.png
13 $(Q)$(IM_PREFIX)montage -tile 2x1 -geometry +0+0 $^ -depth 8 $@
15 # Convert a raster graphic file to 8 bit BMP.
17 # Arguments: OUTFILES, OUTPATTERN, INPATTERN, [PRE_OPTIONS], [POST_OPTIONS]
18 define convert-to-bmp
20 $(1): $(2): $(3) | $$(dir $$(firstword $(1)))/dirstamp
21 @$$(NQ)echo " BMP $$@"
22 $$(Q)$$(IM_PREFIX)convert $$< $(4) +dither -compress none -type optimize -colors 256 $(5) bmp3:$$@
24 endef
26 # Convert a raster graphic file to 8 bit BMP with white background.
28 # Arguments: OUTFILES, OUTPATTERN, INPATTERN, [PRE_OPTIONS], [POST_OPTIONS]
29 define convert-to-bmp-white
31 $(1): $(2): $(3) | $$(dir $$(firstword $(1)))/dirstamp
32 @$$(NQ)echo " BMP $$@"
33 $$(Q)$$(IM_PREFIX)convert $$< $(4) -background white -layers flatten +matte +dither -compress none -type optimize -colors 256 $(5) bmp3:$$@
35 endef
37 # Convert a raster graphic file to 8 bit BMP with white background.
39 # Arguments: OUTFILES, OUTPATTERN, INPATTERN, [PRE_OPTIONS], [POST_OPTIONS]
40 define convert-to-bmp-half
42 $(1): $(2): $(3) | $$(dir $$(firstword $(1)))/dirstamp
43 @$$(NQ)echo " BMP $$@"
44 @$$(NQ)echo " BMP $$(@:1.bmp=2.bmp)"
45 $$(Q)$$(IM_PREFIX)convert $$< $(4) -layers flatten +matte +dither -compress none -type optimize -colors 256 -crop '50%x100%' -scene 1 bmp3:$$(@:1.bmp=%d.bmp)
47 endef