img Command Line Image Processor

img is a command line image processor, in the way of ImageMagick and G'MIC. It simply provides a command line interface to the gimage library, exposing the tools with commands that look like this:

img DSG_0001.NEF:rawdata=crop subtract:camera whitebalance:camera demosaic:ahd 
blackwhitepoint:rgb,data tone:filmic resize:640,0 sharpen:1 DSG_0001.jpg

which opens the NEF as the raw data, subtracts the camera-supplied black value, whitebalances the data with the camera-supplied multipliers, auto-adjusted black/white point to the data limits, resize preserving aspect ratio, just a bit of sharpen, and saves to a JPEG. In the Windows installers, you are queried regarding adding the path to img to the PATH variable; if you intend to use img, that's a good idea.

img has acouple of batch tricks worth mentioning here:

img reads the rawproc configuration file in the default locations, first from the current working directory of img, next from the application default. This allows img tools to use the configured parameters of the respective rawproc tools, as well as the input parameters. Two particular input parameters have special meaning:

  1. input.jpeg|tiff|png|raw.parameters: Applies the input parameters specified in the specified property. For example,
    img "*.NEF:input.raw.parameters" ...

    retrieves the parameter string at input.raw.parameters property and uses them when each input image is opened.
  2. input.raw.libraw: This property tells img to round up all the input.raw.libraw parameters, construct a parameter string from them, and use them to open each image.
These changes now allow img to construct output images that contain processing strings sufficient to allow rawproc to open-source the image and reconstruct it from the original image. The following workflow is possible:
  1. Shoot pictures in raw, all day
  2. At the end of the day, make a directory suitably named for the viewable images, and a subdirectory under it for the raw files
  3. Copy the raw files to the raw file subdirectory
  4. Open a command shell, cd to the raw directory, and run the img command at the top of this page. This will produce viewable JPEGs in the parent directory, sized to 640px on their largest dimension, with a full processing chain in their metadata
  5. At leisure, regard the JPEGs and select ones for re-processing if desired. If one is selected, it can be opened by dragging it to a rawproc desktop shortcut; rawproc will find the processing chain and ask if the original (raw) file is to be opened and re-processed. Say "yes", and the raw file is opened, and the img processing chain is re-applied. You can now modify it at will for various needs, such as creative cropping or resize for a different viewing situation, and save to a different filename, or overwrite the original img-produced JPEG

img Tools