File: ps2png-color

package info (click to toggle)
leptonlib 1.57-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 9,724 kB
  • ctags: 3,900
  • sloc: ansic: 89,715; sh: 3,516; makefile: 718
file content (32 lines) | stat: -rwxr-xr-x 759 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
#   ps2png-color
#
#     Rasterizes a postscript file, saving as a set of 24 bpp RGB png images
#
#     input:  PostScript file
#             root name of output files
#     output: 24 bpp RGB png files for each page


scriptname=${0##*/}

if test $# != 2
then
  echo "usage: " $scriptname " inpsfile outpngroot"
  exit -1
fi

inpsfile=$1
outpngroot=$2

# need mysterious "primer"
# choose one of the two options below

# choice: output image size depending on resolution
echo "0 neg 0 neg" translate | gs -sDEVICE=png16m -sOutputFile=${outpngroot}%03d.png -r300x300 -q - ${inpsfile}

# choice: output fixed image size
#echo "0 neg 0 neg" translate | gs -sDEVICE=png16m -sOutputFile=${outpngroot}%03d.png -g2550x3300 -r300x300 -q - ${inpsfile}