Optimize PNGs to reduce installed size

This commit is contained in:
Aurélien COUDERC
2019-02-04 23:51:16 +01:00
parent 1870085467
commit d422b80a32
42 changed files with 37 additions and 14 deletions
+3 -1
View File
@@ -14,11 +14,13 @@ build: $(foreach SVG,$(LOGOS),$(foreach RES,$(RESOLUTIONS),$(SVG)-$(RES).png))
# Dynamically add rules for PNG generation for each resolution, for each logo file
define SVG_TO_PNG_RULE
$1-$2.png: $1.svg
rsvg-convert $$< -h $2 -o $$@
rsvg-convert $$< -h $2 -o $$@.raw
optipng $$@.raw -out $$@
endef
$(foreach LOGO,$(LOGOS),$(foreach RES,$(RESOLUTIONS),$(eval $(call SVG_TO_PNG_RULE,$(LOGO),$(RES)))))
clean:
rm -f *.png.raw
rm -f *.png
install:
+1
View File
@@ -8,6 +8,7 @@ Uploaders: Yves-Alexis Perez <corsac@debian.org>,
Aurélien COUDERC <zecoucou@free.fr>
Build-Depends: debhelper (>= 11),
librsvg2-bin,
optipng,
# For the number in debian-logo-text
fonts-quicksand
Rules-Requires-Root: no
+3 -1
View File
@@ -23,11 +23,13 @@ build: $(foreach SVG,$(EMBLEMS),$(foreach RES,$(RESOLUTIONS),$(SVG)-$(RES)x$(RES
# Dynamically add rules for PNG generation for each resolution, for each emblem file
define SVG_TO_PNG_RULE
$1-$2x$2.png: $1.svg
rsvg-convert $$< -w $2 -h $2 -o $$@
rsvg-convert $$< -w $2 -h $2 -o $$@.raw
optipng $$@.raw -out $$@
endef
$(foreach EMBLEM,$(EMBLEMS),$(foreach RES,$(RESOLUTIONS),$(eval $(call SVG_TO_PNG_RULE,$(EMBLEM),$(RES)))))
clean:
rm -f *.png.raw
rm -f *.png
install:
+5 -2
View File
@@ -9,6 +9,7 @@ files = \
build: $(files)
clean:
rm -f grub-4x3.png.raw grub-16x9.png.raw
rm -f grub-4x3.png grub-16x9.png
install:
@@ -16,9 +17,11 @@ install:
$(INSTALL_DATA) $(wildcard *.png *.sh) $(DESTDIR)/$(dir)
grub-4x3.png: grub-4x3.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
grub-16x9.png: grub-16x9.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
include ../../Makefile.inc
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 54 KiB

+5 -2
View File
@@ -9,6 +9,7 @@ files = \
build: $(files)
clean:
rm -f grub-4x3.png.raw grub-16x9.png.raw
rm -f grub-4x3.png grub-16x9.png
install:
@@ -16,9 +17,11 @@ install:
$(INSTALL_DATA) $(wildcard *.png *.sh) $(DESTDIR)/$(dir)
grub-4x3.png: grub-4x3.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
grub-16x9.png: grub-16x9.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
include ../../Makefile.inc
Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 269 B

+5 -2
View File
@@ -9,6 +9,7 @@ files = \
build: $(files)
clean:
rm -f grub-4x3.png.raw grub-16x9.png.raw
rm -f grub-4x3.png grub-16x9.png
install:
@@ -16,9 +17,11 @@ install:
$(INSTALL_DATA) $(wildcard *.png *.sh) $(DESTDIR)/$(dir)
grub-4x3.png: grub-4x3.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
grub-16x9.png: grub-16x9.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
include ../../Makefile.inc
Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+5 -2
View File
@@ -9,6 +9,7 @@ files = \
build: $(files)
clean:
rm -f grub-4x3.png.raw grub-16x9.png.raw
rm -f grub-4x3.png grub-16x9.png
install:
@@ -16,9 +17,11 @@ install:
$(INSTALL_DATA) $(wildcard *.png *.sh) $(DESTDIR)/$(dir)
grub-4x3.png: grub-4x3.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
grub-16x9.png: grub-16x9.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
include ../../Makefile.inc
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 B

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

+5 -2
View File
@@ -9,6 +9,7 @@ files = \
build: $(files)
clean:
rm -f grub-4x3.png.raw grub-16x9.png.raw
rm -f grub-4x3.png grub-16x9.png
install:
@@ -16,9 +17,11 @@ install:
$(INSTALL_DATA) $(wildcard *.png *.sh) $(DESTDIR)/$(dir)
grub-4x3.png: grub-4x3.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
grub-16x9.png: grub-16x9.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
include ../../Makefile.inc
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 B

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 KiB

After

Width:  |  Height:  |  Size: 414 KiB

+5 -2
View File
@@ -9,6 +9,7 @@ files = \
build: $(files)
clean:
rm -f grub-4x3.png.raw grub-16x9.png.raw
rm -f grub-4x3.png grub-16x9.png
install:
@@ -16,9 +17,11 @@ install:
$(INSTALL_DATA) $(wildcard *.png *.sh) $(DESTDIR)/$(dir)
grub-4x3.png: grub-4x3.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
grub-16x9.png: grub-16x9.svg
rsvg-convert $< -o $@
rsvg-convert $< -o $@.raw
optipng $@.raw -out $@
include ../../Makefile.inc