Skip to content

Instantly share code, notes, and snippets.

@maning

maning/blend.sh Secret

Last active July 15, 2018 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maning/a2e59f1662ba7263b2a3616d0fb5e139 to your computer and use it in GitHub Desktop.
Save maning/a2e59f1662ba7263b2a3616d0fb5e139 to your computer and use it in GitHub Desktop.
#!/bin/bash -x
#Blend images and segmentation together using imagemagick
images=660c5321-images #path imagery tiles
seg=660c5321-segmentation #path segmentation tiles
out=660c5321-blend #path to save the blended tiles
for z in $images/*;
do for x in $z/*;
do for y in $x/*;
do composite -dissolve 50 -gravity Center \
$images/"$(basename $z)/$(basename $x)/$(basename $y)" \
$seg/"$(basename $z)/$(basename $x)/$(basename $y .webp).png" \
-alpha Set \
$out/"$(basename $z)/$(basename $x)/$(basename $y .webp).png";
done;
done;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment