From 8aa8a9082eb362ff8ebe7a86f37d2ce6f155da22 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 17:51:20 +0100 Subject: make-realwallpaper: add usage --- util/bin/make-realwallpaper | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 util/bin/make-realwallpaper (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper new file mode 100755 index 00000000..212b1786 --- /dev/null +++ b/util/bin/make-realwallpaper @@ -0,0 +1,46 @@ +#!/bin/sh + +###### USAGE ##### +#run in new directory(will be polluted with images +#just run ./make-realwallpaper + + + +if ! ping -w 10 8.8.8.8 | sed -n '/time=[1-9.]* ms/{p;q}'|grep -q . ; then + echo "we need internet" + exit 1 +fi + +curl -z Nightmap_bare.jpg http://awka.sourceforge.net/Night_le_huge.jpg -o Nightmap_bare.jpg +curl -z Daymap_bare.png http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png -o Daymap_bare.png +curl -z Clouds.jpg http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg -o Clouds.jpg + +#resize the Daymap +convert Daymap_bare.png -scale 4000x2000 Daymap.png +#convert Daymap to a snow only alphamap +convert Daymap.png -threshold '95%' Daymap_snowmask.png + +#create a full snowmap in the nightcolor +convert Daymap.png -fill '#0a3b5c' -colorize '100%' Nightmap_fullsnow.png +#get nightlights out of Nightmap_bare +convert Nightmap_bare.jpg -threshold '25%' -transparent '#000000' Nightmap_lightmask.png +#composite Snowmask and Fullsnow to Nightmap_snowlayer +convert Nightmap_fullsnow.png Daymap_snowmask.png -alpha off -compose copy_opacity -composite Nightmap_snowlayer.png +#cut out the lights in Nightmap_lightmask and put them in Nightmap_lightlayer +convert Nightmap_bare.jpg Nightmap_lightmask.png -alpha off -compose copy_opacity -composite Nightmap_lightlayer.png + +#Composite the Nightmap_snowlayer and the Nightmap_lightlayer with the Nightmap +composite Nightmap_lightlayer.png Nightmap_snowlayer.png Nightmap_lightsnowlayer.png +composite Nightmap_lightsnowlayer.png Nightmap_bare.jpg Nightmap.png + +#write the xplanet-configfile +cat > xplanet-config << EOF +[earth] +"Earth" +map=Daymap.png +night_map=Nightmap.png +cloud_map=Clouds.jpg +EOF + +xplanet --num_times 1 --geometry 1366x1200 --output xplanet-output.jpg --projection merc -config xplanet-config +convert xplanet-output.jpg -crop 1366x768+0+160 realwallpaper.png -- cgit v1.2.3 From b53410695a3cba576d7c36292c9e10d9045912bc Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 17:58:43 +0100 Subject: make-realwallpaper removed internetcheck --- util/bin/make-realwallpaper | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 212b1786..f6bf9c2f 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -1,16 +1,10 @@ #!/bin/sh +set -euf ###### USAGE ##### #run in new directory(will be polluted with images #just run ./make-realwallpaper - - -if ! ping -w 10 8.8.8.8 | sed -n '/time=[1-9.]* ms/{p;q}'|grep -q . ; then - echo "we need internet" - exit 1 -fi - curl -z Nightmap_bare.jpg http://awka.sourceforge.net/Night_le_huge.jpg -o Nightmap_bare.jpg curl -z Daymap_bare.png http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png -o Daymap_bare.png curl -z Clouds.jpg http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg -o Clouds.jpg -- cgit v1.2.3 From 45ff766f6041493968ddd7a37265fb6baae71dab Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 18:13:54 +0100 Subject: make-realwallpaper less ocean --- util/bin/make-realwallpaper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index f6bf9c2f..22e93b96 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -36,5 +36,5 @@ night_map=Nightmap.png cloud_map=Clouds.jpg EOF -xplanet --num_times 1 --geometry 1366x1200 --output xplanet-output.jpg --projection merc -config xplanet-config -convert xplanet-output.jpg -crop 1366x768+0+160 realwallpaper.png +xplanet --num_times 1 --geometry 1466x1200 --output xplanet-output.jpg --projection merc -config xplanet-config +convert xplanet-output.jpg -crop 1366x768+100+160 realwallpaper.png -- cgit v1.2.3 From 42748584f82c93e674e1c7dc94d90de1f0a364ae Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 18:33:08 +0100 Subject: make-realwallpaper delete files when not image --- util/bin/make-realwallpaper | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 22e93b96..07903ac3 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -5,9 +5,20 @@ set -euf #run in new directory(will be polluted with images #just run ./make-realwallpaper -curl -z Nightmap_bare.jpg http://awka.sourceforge.net/Night_le_huge.jpg -o Nightmap_bare.jpg -curl -z Daymap_bare.png http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png -o Daymap_bare.png -curl -z Clouds.jpg http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg -o Clouds.jpg +curl -z Nightmap_bare.jpg http://awka.sourceforge.net/Night_le_huge.jpg -o Nightmap_bare.jpg & +curl -z Daymap_bare.png http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png -o Daymap_bare.png & +curl -z Clouds.jpg http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg -o Clouds.jpg & +wait + +if file -ib Nightmap_bare.jpg|grep -q ^image/; then + rm Nightmap_bare.jpg +fi +if file -ib Daymap_bare.png|grep -q ^image/; then + rm Daymap_bare.png +fi +if file -ib Clouds.jpg|grep -q ^image/; then + rm Clouds.jpg +fi #resize the Daymap convert Daymap_bare.png -scale 4000x2000 Daymap.png -- cgit v1.2.3 From c68e5fea30904d22caa40084cac929e976f9cb26 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 18:35:46 +0100 Subject: make-realwallpaper now with exit when no image --- util/bin/make-realwallpaper | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 07903ac3..9fb4da7d 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -12,12 +12,15 @@ wait if file -ib Nightmap_bare.jpg|grep -q ^image/; then rm Nightmap_bare.jpg + exit 1 fi if file -ib Daymap_bare.png|grep -q ^image/; then rm Daymap_bare.png + exit 1 fi if file -ib Clouds.jpg|grep -q ^image/; then rm Clouds.jpg + exit 1 fi #resize the Daymap -- cgit v1.2.3 From 97540a6c6bd28d979cd3947ea99733590380f996 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 18:40:04 +0100 Subject: make-realwallpaer boolean fix --- util/bin/make-realwallpaper | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 9fb4da7d..c612bdb9 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -10,15 +10,15 @@ curl -z Daymap_bare.png http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_ curl -z Clouds.jpg http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg -o Clouds.jpg & wait -if file -ib Nightmap_bare.jpg|grep -q ^image/; then +if ! file -ib Nightmap_bare.jpg|grep -q ^image/; then rm Nightmap_bare.jpg exit 1 fi -if file -ib Daymap_bare.png|grep -q ^image/; then +if ! file -ib Daymap_bare.png|grep -q ^image/; then rm Daymap_bare.png exit 1 fi -if file -ib Clouds.jpg|grep -q ^image/; then +if ! file -ib Clouds.jpg|grep -q ^image/; then rm Clouds.jpg exit 1 fi -- cgit v1.2.3 From bcf7b9d980bb9deab72546d1ed6a502980982427 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 18:42:06 +0100 Subject: make-realwallpaper now silent --- util/bin/make-realwallpaper | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index c612bdb9..d8b702f6 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -5,9 +5,9 @@ set -euf #run in new directory(will be polluted with images #just run ./make-realwallpaper -curl -z Nightmap_bare.jpg http://awka.sourceforge.net/Night_le_huge.jpg -o Nightmap_bare.jpg & -curl -z Daymap_bare.png http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png -o Daymap_bare.png & -curl -z Clouds.jpg http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg -o Clouds.jpg & +curl -sSz Nightmap_bare.jpg http://awka.sourceforge.net/Night_le_huge.jpg -o Nightmap_bare.jpg & +curl -sSz Daymap_bare.png http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png -o Daymap_bare.png & +curl -sSz Clouds.jpg http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg -o Clouds.jpg & wait if ! file -ib Nightmap_bare.jpg|grep -q ^image/; then -- cgit v1.2.3 From eb34f03e0a1705089e2df9184277245c8bce9848 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Oct 2013 20:53:25 +0100 Subject: make-readwallpaper: rebuild requires changed deps --- util/bin/make-realwallpaper | 169 +++++++++++++++++++++++++++++++++----------- 1 file changed, 126 insertions(+), 43 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index d8b702f6..2406372e 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -5,50 +5,133 @@ set -euf #run in new directory(will be polluted with images #just run ./make-realwallpaper -curl -sSz Nightmap_bare.jpg http://awka.sourceforge.net/Night_le_huge.jpg -o Nightmap_bare.jpg & -curl -sSz Daymap_bare.png http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png -o Daymap_bare.png & -curl -sSz Clouds.jpg http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg -o Clouds.jpg & -wait - -if ! file -ib Nightmap_bare.jpg|grep -q ^image/; then - rm Nightmap_bare.jpg - exit 1 -fi -if ! file -ib Daymap_bare.png|grep -q ^image/; then - rm Daymap_bare.png - exit 1 -fi -if ! file -ib Clouds.jpg|grep -q ^image/; then - rm Clouds.jpg - exit 1 -fi - -#resize the Daymap -convert Daymap_bare.png -scale 4000x2000 Daymap.png -#convert Daymap to a snow only alphamap -convert Daymap.png -threshold '95%' Daymap_snowmask.png - -#create a full snowmap in the nightcolor -convert Daymap.png -fill '#0a3b5c' -colorize '100%' Nightmap_fullsnow.png -#get nightlights out of Nightmap_bare -convert Nightmap_bare.jpg -threshold '25%' -transparent '#000000' Nightmap_lightmask.png -#composite Snowmask and Fullsnow to Nightmap_snowlayer -convert Nightmap_fullsnow.png Daymap_snowmask.png -alpha off -compose copy_opacity -composite Nightmap_snowlayer.png -#cut out the lights in Nightmap_lightmask and put them in Nightmap_lightlayer -convert Nightmap_bare.jpg Nightmap_lightmask.png -alpha off -compose copy_opacity -composite Nightmap_lightlayer.png - -#Composite the Nightmap_snowlayer and the Nightmap_lightlayer with the Nightmap -composite Nightmap_lightlayer.png Nightmap_snowlayer.png Nightmap_lightsnowlayer.png -composite Nightmap_lightsnowlayer.png Nightmap_bare.jpg Nightmap.png - -#write the xplanet-configfile -cat > xplanet-config << EOF +main() { + # fetch source images in parallel + fetch nightmap.jpg \ + http://awka.sourceforge.net/Night_le_huge.jpg & + fetch daymap.png \ + http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png & + fetch cloud-layer.jpg \ + http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg & + wait + + check_type nightmap.jpg image + check_type daymap.png image + check_type cloud-layer.jpg image + + # downscale daymap to match nightmap + needs_rebuild daymap-final.png \ + daymap.png \ + && convert daymap.png -scale $(image_size nightmap.jpg) daymap-final.png + + # create nightmap-fullsnow + needs_rebuild nightmap-fullsnow.png \ + && convert \ + -size $(image_size nightmap.jpg) \ + 'xc:#0a3b5c' nightmap-fullsnow.png + + # extract daymap-snowmask from daymap-fonal + needs_rebuild daymap-snowmask.png \ + daymap-final.png \ + && convert daymap-final.png -threshold 95% daymap-snowmask.png + + # extract nightmap-lightmask from nightmap + needs_rebuild nightmap-lightmask.png \ + nightmap.jpg \ + && convert nightmap.jpg -threshold 25% nightmap-lightmask.png + + # create layers + make_layer nightmap-snowlayer.png nightmap-fullsnow.png daymap-snowmask.png + make_layer nightmap-lightlayer.png nightmap.jpg nightmap-lightmask.png + + # apply layers + flatten nightmap-lightsnowlayer.png \ + nightmap-lightlayer.png \ + nightmap-snowlayer.png + + flatten nightmap-final.png \ + nightmap-lightsnowlayer.png \ + nightmap.jpg + + # create xplanet output + needs_rebuild xplanet.config \ + && cat >xplanet.config <&2 + rm "$1" + return 1 + fi +} + +# usage: image_size FILENAME +image_size() { + identify "$1" | awk '{print$3}' +} + +# usage: make_mask DST SRC MASK +make_layer() { + if needs_rebuild "$@"; then + echo "make $1 (apply mask)" >&2 + convert "$2" "$3" -alpha off -compose copy_opacity -composite "$1" + fi +} + +# usage: flatten DST HILAYER LOLAYER +flatten() { + if needs_rebuild "$@"; then + echo "make $1 (flatten)" >&2 + composite "$2" "$3" "$1" + fi +} + +# usage: needs_rebuild DST SRC... +needs_rebuild() { + a="$1" + shift + if ! test -e "$a"; then + #echo " $a does not exist" >&2 + result=0 + else + result=-1 + for b; do + if test "$b" -nt "$a"; then + #echo " $b is newer than $a" >&2 + result=0 + fi + done + fi + #case $result in + # 0) echo "$a needs rebuild" >&2;; + #esac + (exit $result) +} + -xplanet --num_times 1 --geometry 1466x1200 --output xplanet-output.jpg --projection merc -config xplanet-config -convert xplanet-output.jpg -crop 1366x768+100+160 realwallpaper.png +main "$@" -- cgit v1.2.3 From 2182792dd9049407d428d8e5607500ae2828eb1a Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 21:59:41 +0100 Subject: make-realwallpaper return 1 instead of -1 --- util/bin/make-realwallpaper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 2406372e..1f16b079 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -119,7 +119,7 @@ needs_rebuild() { #echo " $a does not exist" >&2 result=0 else - result=-1 + result=1 for b; do if test "$b" -nt "$a"; then #echo " $b is newer than $a" >&2 @@ -130,7 +130,7 @@ needs_rebuild() { #case $result in # 0) echo "$a needs rebuild" >&2;; #esac - (exit $result) + return $result } -- cgit v1.2.3 From 9069db1efbd931c3393bbedb73a751851acb25e5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 22:05:41 +0100 Subject: make-realwallpaper rebuild wallpaper every time --- util/bin/make-realwallpaper | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 1f16b079..787112c3 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -61,13 +61,12 @@ main() { map=daymap-final.png night_map=nightmap-final.png cloud_map=cloud-layer.jpg +satellite_file=krebs.sat +marker_file=krebs.mar EOF - needs_rebuild xplanet-output.png \ - daymap-final.png \ - nightmap-final.png \ - cloud-layer.jpg \ - && xplanet --num_times 1 --geometry 1466x1200 \ - --output xplanet-output.png --projection merc -config xplanet.config + # rebuild every time to update shadow + xplanet --num_times 1 --geometry 1466x1200 \ + --output xplanet-output.png --projection merc -config xplanet.config # trim xplanet output needs_rebuild realwallpaper.png \ -- cgit v1.2.3 From 7eab6a09e768654458b3591b9b8fd417d1059147 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 30 Oct 2013 22:31:36 +0100 Subject: make-realwallper new sat version realwallpaper-sat.png --- util/bin/make-realwallpaper | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 787112c3..672ab55f 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -13,6 +13,8 @@ main() { http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png & fetch cloud-layer.jpg \ http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg & + fetch krebs.sat.tle \ + http://www.celestrak.com/NORAD/elements/stations.txt wait check_type nightmap.jpg image @@ -61,17 +63,48 @@ main() { map=daymap-final.png night_map=nightmap-final.png cloud_map=cloud-layer.jpg +EOF + + # create xplanet output satellite version + needs_rebuild xplanet-sat.config \ + && cat >xplanet-sat.config <krebs.sat <krebs.mar < Date: Wed, 30 Oct 2013 22:48:44 +0100 Subject: make-realwallpaper: scale clouds --- util/bin/make-realwallpaper | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 672ab55f..6f0b1423 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -11,7 +11,7 @@ main() { http://awka.sourceforge.net/Night_le_huge.jpg & fetch daymap.png \ http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png & - fetch cloud-layer.jpg \ + fetch clouds.jpg \ http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg & fetch krebs.sat.tle \ http://www.celestrak.com/NORAD/elements/stations.txt @@ -19,13 +19,17 @@ main() { check_type nightmap.jpg image check_type daymap.png image - check_type cloud-layer.jpg image + check_type clouds.jpg image # downscale daymap to match nightmap needs_rebuild daymap-final.png \ daymap.png \ && convert daymap.png -scale $(image_size nightmap.jpg) daymap-final.png + needs_rebuild clouds-final.png \ + clouds.jpg \ + && convert clouds.jpg -scale $(image_size nightmap.jpg) clouds-final.png + # create nightmap-fullsnow needs_rebuild nightmap-fullsnow.png \ && convert \ @@ -62,7 +66,7 @@ main() { "Earth" map=daymap-final.png night_map=nightmap-final.png -cloud_map=cloud-layer.jpg +cloud_map=clouds-final.png EOF # create xplanet output satellite version @@ -72,7 +76,7 @@ EOF "Earth" map=daymap-final.png night_map=nightmap-final.png -cloud_map=cloud-layer.jpg +cloud_map=clouds-final.png satellite_file=krebs.sat EOF -- cgit v1.2.3 From 6431a154a5ee5e6c1e9e3d170079142e9f32f33c Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 31 Oct 2013 00:52:48 +0100 Subject: make-realwallpaper darker night --- util/bin/make-realwallpaper | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 6f0b1423..06a6c794 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -60,18 +60,18 @@ main() { nightmap.jpg # create xplanet output - needs_rebuild xplanet.config \ - && cat >xplanet.config <xplanet.config <xplanet-sat.config <xplanet-sat.config < Date: Thu, 31 Oct 2013 00:58:03 +0100 Subject: make-realwallpaper: use new nightmap --- util/bin/make-realwallpaper | 75 +++++++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 26 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 6f0b1423..8c6f9063 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -7,48 +7,59 @@ set -euf main() { # fetch source images in parallel - fetch nightmap.jpg \ - http://awka.sourceforge.net/Night_le_huge.jpg & - fetch daymap.png \ + #fetch nightmap-old-raw.jpg \ + # http://awka.sourceforge.net/Night_le_huge.jpg & + fetch nightmap-raw.jpg \ + http://www.zeitnews.org/sites/default/files/users/20/article_slideshow_images/nasa-noaa-satellite-reveals-new-views-earth-night-1354814354_0.jpg & + fetch daymap-raw.png \ http://www.nnvl.noaa.gov/images/globaldata/SnowIceCover_Daily.png & - fetch clouds.jpg \ + fetch clouds-raw.jpg \ http://user.chol.com/~winxplanet/cloud_data/clouds_2048.jpg & fetch krebs.sat.tle \ http://www.celestrak.com/NORAD/elements/stations.txt wait - check_type nightmap.jpg image - check_type daymap.png image - check_type clouds.jpg image - - # downscale daymap to match nightmap - needs_rebuild daymap-final.png \ - daymap.png \ - && convert daymap.png -scale $(image_size nightmap.jpg) daymap-final.png - - needs_rebuild clouds-final.png \ - clouds.jpg \ - && convert clouds.jpg -scale $(image_size nightmap.jpg) clouds-final.png + #check_type nightmap-old-raw.jpg image + check_type nightmap-raw.jpg image + check_type daymap-raw.png image + check_type clouds-raw.jpg image + + in_size=1466x1200 + + nightsnow_color='#0c1a49' # nightmap + #nightsnow_color='#0a3b5c' # nightmap-old + + # normalize *-raw.* to *.png + for raw in \ + nightmap-old-raw.jpg \ + nightmap-raw.jpg \ + daymap-raw.png \ + clouds-raw.jpg \ + ; + do + normal=${raw%-raw.*}.png + needs_rebuild $normal $raw || continue + echo "make $normal; normalize $raw" >&2 + convert $raw -scale $in_size $normal + done # create nightmap-fullsnow needs_rebuild nightmap-fullsnow.png \ - && convert \ - -size $(image_size nightmap.jpg) \ - 'xc:#0a3b5c' nightmap-fullsnow.png + && convert -size $in_size xc:$nightsnow_color nightmap-fullsnow.png - # extract daymap-snowmask from daymap-fonal + # extract daymap-snowmask from daymap-final needs_rebuild daymap-snowmask.png \ - daymap-final.png \ - && convert daymap-final.png -threshold 95% daymap-snowmask.png + daymap.png \ + && convert daymap.png -threshold 95% daymap-snowmask.png # extract nightmap-lightmask from nightmap needs_rebuild nightmap-lightmask.png \ - nightmap.jpg \ - && convert nightmap.jpg -threshold 25% nightmap-lightmask.png + nightmap.png \ + && convert nightmap.png -threshold 25% nightmap-lightmask.png # create layers make_layer nightmap-snowlayer.png nightmap-fullsnow.png daymap-snowmask.png - make_layer nightmap-lightlayer.png nightmap.jpg nightmap-lightmask.png + make_layer nightmap-lightlayer.png nightmap.png nightmap-lightmask.png # apply layers flatten nightmap-lightsnowlayer.png \ @@ -57,7 +68,19 @@ main() { flatten nightmap-final.png \ nightmap-lightsnowlayer.png \ - nightmap.jpg + nightmap.png + # nightmap-old.png + + # make all unmodified files as final + for normal in \ + daymap.png \ + clouds.png \ + ; + do + final=${normal%.png}-final.png + needs_rebuild $final && + ln $normal $final + done # create xplanet output needs_rebuild xplanet.config \ -- cgit v1.2.3 From efcc038b9c7712a2caf64826e44c241bff1ef060 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Oct 2013 01:00:21 +0100 Subject: make-realwallpaper: define out_geometry once --- util/bin/make-realwallpaper | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 97b4c0b7..89b65314 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -25,6 +25,7 @@ main() { check_type clouds-raw.jpg image in_size=1466x1200 + out_geometry=1366x768+100+160 nightsnow_color='#0c1a49' # nightmap #nightsnow_color='#0a3b5c' # nightmap-old @@ -116,22 +117,22 @@ EOF EOF # rebuild every time to update shadow - xplanet --num_times 1 --geometry 1466x1200 \ + xplanet --num_times 1 --geometry $in_size \ --output xplanet-output.png --projection merc -config xplanet.config # rebuild everytime satellite version - xplanet --num_times 1 --geometry 1466x1200 \ + xplanet --num_times 1 --geometry $in_size0 \ --output xplanet-sat-output.png --projection merc -config xplanet-sat.config # trim xplanet output needs_rebuild realwallpaper.png \ xplanet-output.png \ - && convert xplanet-output.png -crop 1366x768+100+160 realwallpaper.png + && convert xplanet-output.png -crop $out_geometry realwallpaper.png # trim xplanet-sat output needs_rebuild realwallpaper-sat.png \ xplanet-sat-output.png \ - && convert xplanet-sat-output.png -crop 1366x768+100+160 realwallpaper-sat.png + && convert xplanet-sat-output.png -crop $out_geometry realwallpaper-sat.png } # usage: getimg FILENAME URL -- cgit v1.2.3 From 0a2f8300c7822154c9aa8543a692f5dea022a217 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Oct 2013 01:03:25 +0100 Subject: make-realwallpaper: use new nightmap harder --- util/bin/make-realwallpaper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 89b65314..cf509e7f 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -31,8 +31,8 @@ main() { #nightsnow_color='#0a3b5c' # nightmap-old # normalize *-raw.* to *.png + #nightmap-old-raw.jpg for raw in \ - nightmap-old-raw.jpg \ nightmap-raw.jpg \ daymap-raw.png \ clouds-raw.jpg \ -- cgit v1.2.3 From ef368dc78cee866b6779fdfa013b806f82674445 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Oct 2013 01:04:14 +0100 Subject: make-realwallpaper: fix typo --- util/bin/make-realwallpaper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index cf509e7f..437919b5 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -121,7 +121,7 @@ EOF --output xplanet-output.png --projection merc -config xplanet.config # rebuild everytime satellite version - xplanet --num_times 1 --geometry $in_size0 \ + xplanet --num_times 1 --geometry $in_size \ --output xplanet-sat-output.png --projection merc -config xplanet-sat.config # trim xplanet output -- cgit v1.2.3 From 18e51573b1008175152784eb021c439b4b88c6e7 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 31 Oct 2013 01:05:16 +0100 Subject: make-realwallpaper sat version darker night --- util/bin/make-realwallpaper | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util/bin') diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper index 437919b5..a195b5f1 100755 --- a/util/bin/make-realwallpaper +++ b/util/bin/make-realwallpaper @@ -102,6 +102,8 @@ map=daymap-final.png night_map=nightmap-final.png cloud_map=clouds-final.png satellite_file=krebs.sat +cloud_threshold=10 +shade=15 EOF needs_rebuild krebs.sat \ -- cgit v1.2.3