Skip to content

Instantly share code, notes, and snippets.

@cneud
Last active August 29, 2015 14:00
Show Gist options
  • Save cneud/11049264 to your computer and use it in GitHub Desktop.
Save cneud/11049264 to your computer and use it in GitHub Desktop.
Bash script for image conversion for Europeana Newspapers
#!/bin/bash
# Usage:
# ./eunp-img-conversion.sh input.tif temp.tif output.jp2
# 1. Invoke GraphicsMagick command line to convert master images to uncompressed 150ppi TIF with unsharp mask
# 2. Invoke Kakadu kdu_compress command line to convert uncompressed TIF to JP2000
gm convert $1 -resample 150x150 -unsharp 1.5 -compress None ptif:$2 | kdu_compress -i $2 -o $3 -rate 1.0,0.84,0.7,0.6,0.5,0.4,0.35,0.3,0.25,0.21,0.18,0.15,0.125,0.1,0.088,0.075,0.0625,0.05,0.04419,0.03716,0.03125,0.025,0.0221,0.01858,0.015625 Clevels=6 Stiles=\{1024,1024\} Cmodes=\{BYPASS\} Corder=RLCP Cblk=\{64,64\} -no_palette
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment