Mercurial > hg > mxe-octave-anirudha
changeset 2176:4e68de2de908
Added the script which has been used to compress screenshots and to create thumbnails (*-small.png) for doc/
author | Volker Grabsch <vog@notjusthosting.com> |
---|---|
date | Fri, 16 Dec 2011 10:05:27 +0100 |
parents | 2bbf834b331d |
children | 46ff01670040 |
files | tools/create-screenshot-for-doc |
diffstat | 1 files changed, 32 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
new file mode 100755 --- /dev/null +++ b/tools/create-screenshot-for-doc @@ -0,0 +1,32 @@ +#!/bin/bash +set -eu + +if [ "$#" -ne 2 ]; then + echo + echo "Syntax: $0 [IMAGE.png] [NAME]" + echo + echo 'IMAGE.png -> screenshot-NAME.png + screenshot-NAME-small.png' + echo + exit 1 +fi + +set -v + +IMAGE_FILE="$1" +NAME="$2" + +cat "$IMAGE_FILE" \ +| pngtopnm \ +| pnmtopng -compression 9 \ +> "screenshot-$NAME.png" + +cat "screenshot-$NAME.png" \ +| pngtopnm \ +| pnmscale -ysize 128 \ +> "screenshot-$NAME-small.pnm" + +pnmquant 256 "screenshot-$NAME-small.pnm" \ +| pnmtopng -compression 9 \ +> "screenshot-$NAME-small.png" + +rm -f "screenshot-$NAME-small.pnm"