Created
November 7, 2019 04:06
-
-
Save gghatano/33ecbc05a942dfd3a8d57bfe07eb963e to your computer and use it in GitHub Desktop.
chromeでスクショした地図画像をいい感じにリサイズして切り出したり変換したりした
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir=$(dirname $0) | |
if [ -e "$dir/converted_images" ] ; then | |
echo "output directory exists" | |
else | |
mkdir $dir/converted_images | |
fi | |
ls *.png | grep "_C" | | |
# head -n 2 | | |
while read line | |
do | |
echo $line | |
filename=$(echo $line | awk -F_ -v OFS="_" '{print $9,$10,$11,$12,$13}') | |
baseFilename=$(basename $filename .csv.html.png) | |
cp $line ${baseFilename}.png | |
echo "basefilename: "$baseFilename | |
# convert -trim -resize 500x200 ${baseFilename}.png ${baseFilename}.trim.500x200.png | |
convert -trim -resize 1000x400 ${baseFilename}.png ${baseFilename}.1000x400.png | |
# convert -crop 1000x350+0+0 ${baseFilename}.1000x400.png ${baseFilename}.1000x350.png | |
convert ${baseFilename}.1000x400.png $dir/converted_images/${baseFilename}.png | |
convert ${baseFilename}.1000x400.png $dir/converted_images/${baseFilename}.eps | |
convert ${baseFilename}.1000x400.png $dir/converted_images/${baseFilename}.svg | |
done | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment