raw2jpg - ParanoidNemo/scripts GitHub Wiki

Function

raw2jpg convert raw images (.CR2, .NEF, etc.) recursively into full resolution .jpg, without make any modification to the original files.

The script search into the input directory any file with the indicated raw format and convert it to .jpg, then move the files into the output directory.

IMPORTANT: if there are any file with the same name and the same extension of a converted file they will be overwrite

Dependencies

  • imagemagick

Usage

As Script

raw2jpg takes 3 arguments:

  • indir [-i, --indir]: mandatory, set the directory containing the images to convert. If the indir doesn't exists the script raise an Exception and abort.
  • outdir [-o, --outdir]: set how the converted images are stored at the end of the process (default = ~/foto/convertite). If the outdir doesn't exists it will be created as well as all the parents needed.
  • extension [-e, --extension]: indicate the raw format to the images to convert with . (default = .CR2)

e.g

$ ./raw2jpg -i ~/photo/summer_2015 -o ~/photo/exported -e .NEF

As Module

You can also import raw2jpg as module into another python script, simply using

import raw2jpg

it will import no Classes and one function called raw2jpg.

If you use it as module you have to explicit all 3 arguments in order to use the function.