adding resample to the toolbox

This commit is contained in:
mb@ts 2022-06-09 11:34:24 +02:00
parent 88182d16ed
commit cf80180f2d
2 changed files with 30 additions and 0 deletions

View File

@ -34,6 +34,18 @@ Usage:
Link: <http://osp.kitchen/tools/pdfutils/>
## OSP-tools: `resample.sh`
Dependencies:
- `gs` (Ghostscript)
This will change the resolution of a PDF.
Usage:
./resample input.pdf 150
## Custom VR tools: `make-images-bw.sh`
Dependencies:

18
command-line/tools/resample.sh Executable file
View File

@ -0,0 +1,18 @@
#! /bin/bash
pdffile=$1;
dpi=$2
gs \
-o "${pdffile%.pdf}-resampled.pdf" \
-sDEVICE=pdfwrite \
-dDownsampleColorImages=true \
-dDownsampleGrayImages=true \
-dDownsampleMonoImages=true \
-dColorImageResolution=$dpi \
-dGrayImageResolution=$dpi \
-dMonoImageResolution=$dpi \
-dColorImageDownsampleThreshold=1.0 \
-dGrayImageDownsampleThreshold=1.0 \
-dMonoImageDownsampleThreshold=1.0 \
"${pdffile}"