Site logo

Color correction script

Requirements:

We use an image processor residing on our printshop's server for colour correction.

*note: when moving a file to and from the printshop's server, a copy is automatically made. Right now, I have to reveal an image in the finder (on the L'Express server); drag it to the appropriate folder residing on the printshop server; drag the processed image back into the original folder; delete the remaining processed file on the printshop server; relink to the processed file which now resides in the original folder.

The goal is take simplify the process so that everyone can colour correct images.

Send image

Take the active image, and move the file into:

Depending the rules below, it will go into one of the following paths:

Rules

Image processing

This is what the printshop server currently does via scripting:

All images are processed and automatically placed in the following path: /Volumes/L'Express Intellitune/Fichiers Traites (It usually takes around 30 seconds to a minute to process an image)

After being processed, the printshop server script adds to the end of an image file name either "_CMYK" (if it was processed in a colour folder) or "_GREY" (if it was processed in a gray folder).

Example:
Original file name = "Kas image" Processed file name = "Kas image_CMYK"

Retrieving image

The script retrieves the processed image from "/Volumes/L'Express Intellitune/Fichiers Traites". Moves it back into the the image's original directory. Deletes the processed copy residing in the "Fichiers Traites" directory.

It relinks the image to the processed image.

Scenario

At start, the script checks:

Then the main part goes:

  1. Get pixel dimensions via Bridge: if one of the sides is smaller than 300 px, give warning and stop; if less than 900 px, the image goes to one of two "no sharp" folders (CMYK or Gray)
  2. Check the page number: if it's >= 5 and <= 8, it goes to CMYK, otherwise to Gray folder
  3. Copy image to the destination folder
  4. If the image was successfully copied, trigger the sub-script for relinking the image

The sub-script runs automatically every 10 seconds doing the following:

  1. Get base name and extension of the link (the current link is remembered in the main part)
  2. Check if the image — base name + _CMYK. or _GREY. suffix + extension — exists in the Fichiers Traites folder. If so, move it to the original link's folder.
  3. If the image was successfully moved, relink the image and remove the sub-script from the memory.

Another sub-script does the following:

When an image — link’s base name + “_sRGB” suffix + link’s extension (“tif” in case of a resaved png-file) — appears in the Fichiers Traites folder, the script tries to move it to the active book’s “Web” folder. If it fails to do this within 60 secs, it gives up and the idle task is removed.

The both sub-scripts (idle tasks) — relink CMYK/GRAY and move sRGB — are enclosed in try/catch blocks. So if something goes wrong here, the script gives a warning and removes all idle tasks to prevent some erratic behavior of InDesign.

Download the current version of the script from here.

Go back to the main Scripts for L'Express de Toronto Inc. page