ImageProcessing

Welcome

 Welcome to Michèle’s ImageProcessing plugin, designed to add meaning full information to the top of pages: page number, current chapter and last section header.

Return to plugins section. Return to the InDesign Automation page. Return to the Home page.
For information on other plugins please go to my InDesign Automation page plugins section.

General information

Plugin name: ImageProcessing
Version: 1.0.0 – 8/18/26
Fee: US$199.99 – includes minor updates until major version release
Availability: Adobe Marketplace
Status: Not yet published
Source code in book:  Adobe InDesign Automation of Nonfiction Books via JavaScript

Requirements

The author embeds images into his/her manuscript; he/she must then provide the following: name the images, a position which defines where the image should be located, a caption to place under the image, and at least one cross-reference to the image somewhere inside the manuscript. These requirements are fulfilled via <img> image tags and <fig> cross-reference tags.

  • Name images – Embedded images in Word may be named via the image’s Alt Text property. Select the image, right click, and look for Alt Text down in the choices offered. InDesign, upon importing the manuscript, places the image in a Rectangle Frame which has an Object Export Options property; InDesign automatically transfers the image’s name to it; it serves as a link between the image and the <img> tag, next paragraph.
  • Image tags <img>imgName[A]imgCaption</img> enable matching tags with images. They also enable the author to define where images should to appear. The algorithm uses the second part of the tag to create a caption.
  • Image cross-references – The author inserts images for a purpose; he/she wants to cross-reference them. This is done via the <fig>imgName</fig> tag inserted anywhere inside the manuscript. The identifier gets added to the image’s name, the result being something like Fig. 12.7 – IDPages pane page 77.

What it does

The ImageProcessing plugin’s objective consists in transforming raw images as provided in the author’s manuscript into a pleasing, informative, meaningful image which enhances the author’s narrative. Once processed, images must respond to the following objectives:

  1. Position – They must be positioned as near as possible relative to the author’s intent.
  2. Identifier – They should be identifiable according to the chapter they are located in and their sequence in the chapter, ex. Fig. 12.7: chapter twelve, seventh image.
  3. Captions – Images should have a caption under them. These should be grouped with the corresponding images so that the InDesign professional could move them as a single unit.
  4. Cross-referencing – Images should have at least one cross-reference pointing to it somewhere in the manuscript, the result being something like Fig. 12.7 – IDPages pane page 77.
  5. Resolution – Their resolution should be 300 DPI. This is required for print. Amazon KDP automatically adjusts resolution to 72 DPI for ePub (Kindle) documents.

The five objectives above may be achieved via HTML-like tags and appropriate JavaScript programming, as follows:

  • Removing image anchors  – Images embedded in the Word manuscript are anchored to text and overlay it. The only solution to releasing anchors lies in cutting/pasting them. Since images occupy a great deal of text real-estate, whatever an algorithm does to the document which causes text to reflow, images are a drag to reflow and impact processing time negatively. The solution lies in cutting images and pasting them to page 1 out of the manuscript’s location.  Moving images to their intended destination should be undertaken when all other automation task (indexes, cross-references, etc.) have completed their work.
  • Identifiers – When looking at an image or at an image cross-reference, the reader should see something like Fig. 12.7; this is an identifier. The algorithm determines which chapter images are located in and their sequence within the chapter to create an identifier such as Fig. 12.7. These are inserted on the beginning of captions and cross-references.
  • Captions – The ImageProcessing plugin creates text frames into which it inserts the caption obtained from the <img> tag after adding the image’s identifier to it. It positions the captions thus created under the corresponding images and groups them with the images.
  • Move images to their destination page – The image/caption groups located in page 1 get moved to their destination pages, i.e. the pages the <img> tags are located in. Please note that the algorithm sizes the caption’s height according to the caption’s content. After moving the image/caption groups to their destination page, the algorithm converts the image <img> tag into a group tag as follows: <grp>imgName[A]identifier – Please remove</grp>. The InDesign user uses these tags to fine tune image positioning.
  • Image positioning – The InDesign user fine tunes image positioning via the location of <grp> tags. Once positioned satisfactorily, the InDesign user removes the tags. This process is undertaken image by image downwards into the document when there is no risk that the document might undergo changes.
  • Resolution – Print requires that images have a 300 DPI resolution which poses somewhat of a challenge. The author gets his/her images from somewhere, most probably by snipping them from the screen. They are large; I call these raw images; their resolution is 72 DPI. The author imports them into his/her manuscript and downsizes them as he/she sees fit. They now have a new size; their resolution can be anything. The InDesign professional thus gets images whose resolution is anything. When the document is ready to publish, the InDesign professional needs to redefine a set of 300 DPI images, same width and height, and relink them to the InDesign document. The ImageProcessing plugin generates a list of images along with their width and height in the ImageProcessing.txt file to enable images to be set to 300 DPI yet maintain their dimensions. I used Claude to generate images with the correct resolution and size. A JavaScript script I created enables relinking images in no time; its code is available in my InDesign automation book.

Please note that a dialog box displays the HOMEDIR full path to enable the plugin user find the ImageProcessingReadme.txt file.

For more information

You will find source code in my InDesign automation book so that you could roll your own ImageProcessing plugin.
For information on other plugins please go back to my InDesign Automation page plugins section.
Return to the InDesign automation page.