I have an InDesign script which places a photo in a document and then puts some text over it. The photo can be either dark or light, so the text should be either black or white. For this to work I need my script to be able to get the information about the colors in this photo. Is there a way to get this information using ID's ExtendScript?

  • No i dont think theres no direct querry for either of those. But obviously it can call uppon photoshop or say imagemagick to do this for you.
    – joojaa
    Jul 25, 2022 at 11:16
  • It should be possible to use ExtendScript to: open the image in Photoshop, flatten the image, apply average blur, pick the first pixel in the image, decide whether you regard that pixel as dark or light and then use that variable in your InDesign script.
    – Wolff
    Jul 25, 2022 at 13:31
  • External program (like PS or imagemagick) is certainly an option, but it can be quite slow. It's a pity that while ID itself has Object/Extract from image/Color themes which could potentially do the trick, I found no way to use it from a script. Jul 26, 2022 at 9:30


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.