mirror of
https://github.com/est31/leaftest.git
synced 2025-01-03 14:50:38 +01:00
Use SSIM based downscaling when the program is available, else use convert
This commit is contained in:
parent
ff970a8687
commit
89cd4b5a91
@ -27,6 +27,11 @@ Get a clone:
|
|||||||
git clone --recursive https://github.com/est31/leaftest.git
|
git clone --recursive https://github.com/est31/leaftest.git
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Compile the downscaler:
|
||||||
|
```
|
||||||
|
(cd downscaling && sh compile.sh)
|
||||||
|
```
|
||||||
|
|
||||||
To start the mapping, do:
|
To start the mapping, do:
|
||||||
```
|
```
|
||||||
MAPPERDIR=dir/containing/minetestmapper ./mapper.sh path/to/world spawnx,spawny dimension
|
MAPPERDIR=dir/containing/minetestmapper ./mapper.sh path/to/world spawnx,spawny dimension
|
||||||
|
15
mapper.sh
15
mapper.sh
@ -16,6 +16,19 @@ if [ ! -f $mapperpath ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f downscaling/perc ]; then
|
||||||
|
echo "Using SSIM based downscaling"
|
||||||
|
downscale() {
|
||||||
|
downscaling/perc 2 < $1 > ${1}_small
|
||||||
|
mv -f ${1}_small $1
|
||||||
|
}
|
||||||
|
else
|
||||||
|
echo "Using downscaling provided by imagemagick"
|
||||||
|
downscale() {
|
||||||
|
convert $1 -resize 50% $1
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$JOBNUM" ]; then
|
if [ -z "$JOBNUM" ]; then
|
||||||
JOBNUM=1
|
JOBNUM=1
|
||||||
fi
|
fi
|
||||||
@ -111,7 +124,7 @@ do
|
|||||||
echo "montage exited with non zero exit code, aborting."
|
echo "montage exited with non zero exit code, aborting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
convert $dir/map_${x}_${y}.png -resize 50% $dir/map_${x}_${y}.png \
|
downscale $dir/map_${x}_${y}.png \
|
||||||
2> >(>&2 prefix "[SHRINK $zlv/map_${x}_${y}.png ERR]: ") | prefix "[SHRINK $zlv/map_${x}_${y}.png]: "
|
2> >(>&2 prefix "[SHRINK $zlv/map_${x}_${y}.png ERR]: ") | prefix "[SHRINK $zlv/map_${x}_${y}.png]: "
|
||||||
if [ ${PIPESTATUS[0]} -ne 0 ]; then
|
if [ ${PIPESTATUS[0]} -ne 0 ]; then
|
||||||
echo "shrinking exited with non zero exit code, aborting."
|
echo "shrinking exited with non zero exit code, aborting."
|
||||||
|
Loading…
Reference in New Issue
Block a user