source: subversion/applications/rendering/toposm/combine-color-relief-tiles @ 29599

Last change on this file since 29599 was 24242, checked in by ahlzen, 9 years ago

Tweaked layer compositing to make highlights less overblown.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/bash
2
3# syntax: combine <rootTileDir> <z> <x> <y> <size(pixels)>
4
5ROOTTILEDIR=$1
6Z=$2
7X=$3
8Y=$4
9SIZE=$5
10
11echo "Combining color-relief tile at $Z $X $Y..."
12
13# * Multiplies/screens hillshade over colormap tile.
14# * Pastes "areas" on top
15# * Fills non-masked areas from watermask with blue.
16COLORRELDESTDIR="$ROOTTILEDIR/color-relief/$Z"
17COLORRELTILE="$COLORRELDESTDIR/s${X}_${Y}.png"
18HILLSHADETILE="$ROOTTILEDIR/hillshade/$Z/s${X}_${Y}.png"
19COLORMAPTILE="$ROOTTILEDIR/colormap/$Z/s${X}_${Y}.png"
20WATERMASKTILE="$ROOTTILEDIR/watermask/$Z/s${X}_${Y}.png"
21AREATILE="$ROOTTILEDIR/area/$Z/s${X}_${Y}.png"
22mkdir -p "$COLORRELDESTDIR"
23if [ ! -f "$COLORRELTILE" ] ; then
24    convert \
25        -size ${SIZE}x${SIZE} xc:"#aaddff" \
26        \( \
27                "$COLORMAPTILE" -modulate 120 \
28                "$AREATILE" -compose Over -composite \
29                \( "$HILLSHADETILE" -level 70,95% +level 0%,80% \) \
30                -compose screen -composite \
31                \( "$HILLSHADETILE" -level 0,75% +level 40%,100% \) \
32                -compose multiply -composite -modulate 92 \
33        \) \
34        "$WATERMASKTILE" -compose Src_over -composite \
35        -quality 92 "$COLORRELTILE"
36else
37    echo "Color-relief tile at $Z $X $Y exists."
38fi
39
Note: See TracBrowser for help on using the repository browser.