From 4b0cec1757c0376f424f8e13f757afe8e9888634 Mon Sep 17 00:00:00 2001 From: Artem Pastukhov Date: Mon, 14 Dec 2015 11:34:11 +0300 Subject: [PATCH 1/3] * Add u8glib readme. --- app/u8glib/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/u8glib/README.md diff --git a/app/u8glib/README.md b/app/u8glib/README.md new file mode 100644 index 00000000..11530966 --- /dev/null +++ b/app/u8glib/README.md @@ -0,0 +1,28 @@ +##U8glib package + +Ported from https://github.com/olikraus/u8glib + + +Here is black magic with ImageMagic package for image conversion: + + + +```bash +#!/bin/bash + +mkdir out + +for icon in *png; do + convert $icon -depth 1 ./out/$(basename $icon .png)_1bpp.png + if [[ "$icon" == *"black"* ]]; then + convert ./out/$(basename $icon .png)_1bpp.png -background white -alpha Background ./out/$(basename $icon .png)_1bpp.xbm + else + convert ./out/$(basename $icon .png)_1bpp.png -background black -alpha Background ./out/$(basename $icon .png)_1bpp.xbm + fi + cat ./out/$(basename $icon .png)_1bpp.xbm | tr '\n' ' ' | tr -d " " |sed -e s'#^.*{##g' | sed s'#,}##' |sed s'/;//' | xxd -r -p > ./out/$(basename $icon .png).xbm.mono +done + +rm out/*png out/*xbm +``` + +It read all the png in the current folder and put resulting mono to ./out/ From 60096023829f60f3ecebd847b064f1f50fcb68e5 Mon Sep 17 00:00:00 2001 From: Artem Pastukhov Date: Mon, 14 Dec 2015 11:41:10 +0300 Subject: [PATCH 2/3] Some polish --- app/u8glib/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/u8glib/README.md b/app/u8glib/README.md index 11530966..07acdf9d 100644 --- a/app/u8glib/README.md +++ b/app/u8glib/README.md @@ -25,4 +25,4 @@ done rm out/*png out/*xbm ``` -It read all the png in the current folder and put resulting mono to ./out/ +Convert all the png in the current folder and put resulting .mono to ./out From 5cb27f89ae434e2df78c52c30422046f2574f773 Mon Sep 17 00:00:00 2001 From: Artem Pastukhov Date: Tue, 15 Dec 2015 09:35:20 +0300 Subject: [PATCH 3/3] Add ImageMagic info. --- app/u8glib/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/u8glib/README.md b/app/u8glib/README.md index 07acdf9d..ed5598f8 100644 --- a/app/u8glib/README.md +++ b/app/u8glib/README.md @@ -24,5 +24,11 @@ done rm out/*png out/*xbm ``` - Convert all the png in the current folder and put resulting .mono to ./out + +The convert binary is a part of ImageMagic package. You need to install it. + +``` +sudo apt-get install imagemagick +``` +for Debian/Ubuntu. \ No newline at end of file