Xmarks Top Site in Adobe Scripting


Color2Gray

This is a free download; it supports Mac & Windows versions of InDesign CS, CS2, CS3 or CS4.

Goal

This tool allows you to convert placed color photos to grayscale without modifying the original color image. It works best for JPEG and TIFF images. As far as we know, complex, multi-layered Photoshop images don’t always work – so you might want to stick to JPEG or TIFF.

Sometimes you want a particular picture to be output as a grayscale image, yet the original image is in color.

You could open the image in Adobe® Photoshop® and convert it to grayscale, but instead you can also use this plug-in. When using this tool, the original image is not changed and remains in color, yet it is output as a grayscale image.

When outputting in CMYK, the gray image will only render on the black (K) plate.

Download

This is a free download. Before you can use the Color2Gray plug-in you also have to install our free APID ToolAssistant plug-in, which is available as a second, separate download.

Download the Color2Gray plug-in (version 1.0.10. Free download. For InDesign CS, CS2, CS3 and CS4 on Mac or Windows; does not include the APID ToolAssistant. Don’t worry about the icon of the .spln file: it might not be a ‘regular’ icon, and that’s OK)

You don’t need to purchase a license for APID ToolAssistant (but we’re always grateful if you do – it helps us fund further development). The Color2Gray plug-in will work fine with an unlicensed APID ToolAssistant.

To encourage us by purchasing the US$25 optional license, select the API – APID ToolAssistant… menu item, select the ‘APID ToolAssistant’ entry in the list, and click the Get License… button. Purchasing a license helps us fund further development of cool stuff!

If you don’t purchase a license, APID ToolAssistant will show itself as ‘Demo’ for the first 20 days after it was first installed, and after the 20 days are up, it will change to ‘Unlicensed’. Don’t be alarmed by this. It will not stop working. Color2Gray works with an unlicensed version of APID ToolAssistant, and purchasing a license is optional.

Let us know if this tool is useful to you, at pluginsupport@rorohiko.com. Thanks!

Installation

Please make sure you have a copy of the APID ToolAssistant plug-in installed.

Make sure you install the proper plug-in for your version of InDesign. InDesign CS, CS2, CS3 and CS4 plug-ins are mutually incompatible.

If you already have an APID ToolAssistant plug-in installed (e.g. because you use one of our other plug-ins), make sure it is up-to-date.

APID ToolAssistant used to be called ‘Active Page Item Runtime‘ – if you have any copies of Active Page Item Runtime or Active Page Item Developer installed, please remove them, and replace them with APID ToolAssistant.

When installing plug-ins make sure you copy plug-in files, not the folders they are contained in.

Copy the Color2Gray.spln into the same folder as the APID ToolAssistant plug-in you installed (typically that will be the InDesign Plug-Ins folder). Don’t worry about the icon of the .spln file: it might not be a ‘regular’ icon, and that’s OK.

Usage

After you have installed the plug-ins, select one or more placed color images. Then right-click or control-click the selection. In the context menu there should be a menu item called API(shorthand for Active Page Item).

This menu item should contain an option Force Render as Gray which you can select to make the images render in grayscale.

On the menu bar, in the API menu item, you should also find two new menu items – these duplicate the function of the context menus.

If you want you can assign keyboard shortcuts to these menu items via Edit – Keyboard Shortcuts… (product area Active Page Item).

In short, the procedure is:

  1. Select image
  2. Right-click (Win) or Control-click (Mac)
  3. Select API – Force Render as Gray from the context menu

After an image is converted to grayscale the context menu will change – you can convert back to a color image if so desired – the menu item changes to ‘Render Normally’.

Let us know if this plug-In is useful to you, at pluginsupport@rorohiko.com. Thanks!

Limitations

There are currently two known limitations.

First, the conversion to grayscale is done by InDesign, and you have no control over the process.

InDesign does a pretty good job, and this will suffice for many people, but if you want more specialized conversions (e.g. switch off color management, fiddle with curves,…) then this plug-in won’t help you. In other words – it’s back to Photoshop, and create an edited grayscale copy there.

Second limitation: Color2Gray only handles simple bitmap images . It does not work on vector images (Illustrator, EPS,…), and we’ve also encountered complex Photoshop images (with multiple layers) that could not be handled by Color2Gray. Please test thoroughly and check the printed output before going live!

For scripters and the technically inclined

The C++ part of this tool will check the script label of each placed image. If the script label is equal to the word ‘gray’ then it will force the image to be rendered in grayscale.

The scripted part of this tool is nothing more than a set of menu items and some logic to set the script label to ‘gray’ or the empty string.

If you want to automate the conversion to gray with AppleScript, ExtendScript, or VBScript, all you need to do is change the script label of the image.

To check this out for yourself, proceed as follows:

  • Place a color picture in InDesign
  • Select it with the ‘hollow arrow’ selection tool (the Direct Selection Tool).
  • Bring up the Script Label palette (either under Window – Scripting – Script Label (for CS) or Window – Automation – Script Label (for CS2 and CS3).
  • For the script label, type the word ‘gray’ and then hit the ‘Tab’ key (to force the entry to ‘take’)
  • Erase the word ‘gray’ to revert to color

To perform this operation from a script: look up the ‘label’ attribute.

Version history

10-Nov-2008: Version 1.0.10:

  • CS4 support

15-Jun-2008: Version 1.0.9:

  • Fixed clipping path issues in CS3 (in some cases the clipping path would be turned inside-out when printing – only showing the image parts outside the clipping path instead of inside).

16-Jun-2007: Version 1.0.8:

  • Fixed issues related to scaled images, and images with clipping paths

15-Jun-2007: Version 1.0.7:

  • Added CS3 support
  • Fixed issue for images with clipping paths

27-Jun-2006 Version 1.0:

  • Initial beta release.

28-Aug-2006: Version 1.0.6:

  • Fixed issue where some grayed images would still print in color.

23-Aug-2006: Version 1.0.5:

  • Fixed issue with ‘clipping’ of gray images

23-Aug-2006 Version 1.0.4:

  • Now supports transparency applied to image
  • Now supports embedded images
  • Fixed InDesign slowdown when many objects are selected

16-Aug-2006 Version 1.0.3:

  • Fixed JavaScript issues that could cause error dialogs

15-Aug-2006 Version 1.0.2:

  • Switched to a totally different technique to force the gray rendering. This version properly shoves all the pixels of the image onto the black plate. This means that if an image is forced to gray in a CMYK job, it will only appear on the K plate, and nothing will show up on the C/M/Y plates.

27-Jun-2006 Version 1.0.1:

  • Changed ‘Luminosity’ to ‘Lighten’

Back to the InDesign Plug-Ins page

Back to Home Page