summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-10-30 18:39:17 +0100
committermakefu <github@syntax-fehler.de>2013-10-30 18:39:17 +0100
commit5c8e63c7c45d6d3b864ff7013940ee01aeb72ee3 (patch)
treeac03ff7ed55a6b5e80310d1625faf3ff1d6b4951 /util
parentab0de77130a1ef639debc074579792cbef116128 (diff)
parentc68e5fea30904d22caa40084cac929e976f9cb26 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'util')
-rwxr-xr-xutil/bin/make-realwallpaper54
1 files changed, 54 insertions, 0 deletions
diff --git a/util/bin/make-realwallpaper b/util/bin/make-realwallpaper
new file mode 100755
index 00000000..9fb4da7d
--- /dev/null
+++ b/util/bin/make-realwallpaper
@@ -0,0 +1,54 @@
+#!/bin/sh
+set -euf
+
+###### USAGE #####
+#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 &
+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
+[earth]
+"Earth"
+map=Daymap.png
+night_map=Nightmap.png
+cloud_map=Clouds.jpg
+EOF
+
+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