Skip to main content
Known Participant
July 13, 2010
Answered

cs4 converting to grayscale

  • July 13, 2010
  • 3 replies
  • 79706 views

Hello all, I have a document in CMYK color and im having trouble converting it's swatches to grayscale. I did a search and it only yielded Grayscale converstion at the PDF level. However the Grayscale color space seems to have been removed from the options available in the PDF maker dialogue box. Anyone have some suggestions? Thanks!

    This topic has been closed for replies.
    Correct answer Jongware

    Sure. I have been thinking for a while it could be useful -- after all, it is an option in Illustrator. (But then we've known for years now that the programmers of InDesign Do Not Talk to the ones of Illustrator. I bet there is a Movie of the Week in that story...)

    This extremely quick-and-dirty script converts a swatch of choice to Lab color, then uses the L component for the Black part in a CMYK color. It should also be possible to convert it to a tint of black, but that's just a bit more work.

    (Copy, paste into Adobe's ESTK Editor, save as "SwatchToGray.jsx" into your User Scripts folder. Only works with simple RGB, Lab, or CMYK swatches; not with gradients, tints, Pantones, imported colors, mixed ink groups, or anything else that's not a simple swatch.)

    //DESCRIPTION:Convert a color swatch to grayscale

    // Jongware, 13-Jul-2010

    var myDialog = app.dialogs.add({name:"Swatch To Gray", canCancel:true});
    swatchlist = [];
    namelist = [];
    for (i=4; i<app.activeDocument.swatches.length; i++)
    {
    if (!(app.activeDocument.swatches.hasOwnProperty("baseColor") || app.activeDocument.swatches.hasOwnProperty("gradientStops")))
    {
      swatchlist.push(app.activeDocument.swatches);
      namelist.push(app.activeDocument.swatches.name);
    }
    }
    with (myDialog)
    {
    with (dialogColumns.add())
    {
      with (dialogRows.add())
      {
       staticTexts.add ({staticLabel:"Swatch"});
       swatchDropDown = dropdowns.add ({stringList:namelist, selectedIndex:0});
      }
    }
    }

    if (myDialog.show())
    {
    // Fetch selection
    swatch = swatchlist[swatchDropDown.selectedIndex];
    // Convert to RGB:
    swatch.space = ColorSpace.LAB;
    // Make quick-and-dirty gray
    gray = swatch.colorValue[0];
    // Convert to CMYK
    swatch.space = ColorSpace.CMYK;
    // Set color
    swatch.colorValue = [0,0,0, 100-gray];
    }

    3 replies

    Known Participant
    July 13, 2010

    Yes, I found the Acrobat convert colors capability. However is there anyway to turn an Indesign swatch into a grayscale color? I'd like to make it into a seperate file just for testing purposes.

    Jongware
    JongwareCorrect answer
    Braniac
    July 13, 2010

    Sure. I have been thinking for a while it could be useful -- after all, it is an option in Illustrator. (But then we've known for years now that the programmers of InDesign Do Not Talk to the ones of Illustrator. I bet there is a Movie of the Week in that story...)

    This extremely quick-and-dirty script converts a swatch of choice to Lab color, then uses the L component for the Black part in a CMYK color. It should also be possible to convert it to a tint of black, but that's just a bit more work.

    (Copy, paste into Adobe's ESTK Editor, save as "SwatchToGray.jsx" into your User Scripts folder. Only works with simple RGB, Lab, or CMYK swatches; not with gradients, tints, Pantones, imported colors, mixed ink groups, or anything else that's not a simple swatch.)

    //DESCRIPTION:Convert a color swatch to grayscale

    // Jongware, 13-Jul-2010

    var myDialog = app.dialogs.add({name:"Swatch To Gray", canCancel:true});
    swatchlist = [];
    namelist = [];
    for (i=4; i<app.activeDocument.swatches.length; i++)
    {
    if (!(app.activeDocument.swatches.hasOwnProperty("baseColor") || app.activeDocument.swatches.hasOwnProperty("gradientStops")))
    {
      swatchlist.push(app.activeDocument.swatches);
      namelist.push(app.activeDocument.swatches.name);
    }
    }
    with (myDialog)
    {
    with (dialogColumns.add())
    {
      with (dialogRows.add())
      {
       staticTexts.add ({staticLabel:"Swatch"});
       swatchDropDown = dropdowns.add ({stringList:namelist, selectedIndex:0});
      }
    }
    }

    if (myDialog.show())
    {
    // Fetch selection
    swatch = swatchlist[swatchDropDown.selectedIndex];
    // Convert to RGB:
    swatch.space = ColorSpace.LAB;
    // Make quick-and-dirty gray
    gray = swatch.colorValue[0];
    // Convert to CMYK
    swatch.space = ColorSpace.CMYK;
    // Set color
    swatch.colorValue = [0,0,0, 100-gray];
    }

    Jongware
    Braniac
    July 13, 2010

    Jong you're the master! It works beautifully! So I take it there is no other way to convert these colors IN indesign without this script? That is amazing. Now that you mention the two teams don't talk, I can see it very clearly. It never made sense to me the small simple things that should be standard in adobe applications (like a standard dialogue box for paragraph styles search function ect ect) for all of its CS. Strange yet informative. That leaves it up to the innovation of the users I supose. Thanks again Jongware!


    Now that you mention the two teams don't talk, I can see it very clearly.

    I don't actually know that, but I think that may account for:

    1. Differences in the UI. The Find Font dialog, for example, looks and behaves totally different (call it up in Illy with Alt down; programmer's sense of humor...)

    2. Differences in options. AI can convert colors to and from grayscale. (Even with imported images!)

    3. Typographic options. I prefer ID's dropdown menus over Illy's icons, but perhaps you could have both.

    4. No configurable Keyboard Shortcut Editor in Illy?

    5. No actions in InDesign?

    6. Ehm. Everything else you hate about InDesign and love in Illy, and the other way around. (I'm sure there are more. Anyone else?)

    Colin Flashman
    Braniac
    July 13, 2010

    agree with jongware, its not an option with exporting a pdf.

    however, if you have acrobat pro, an entire pdf can be forced to greyscale. in acrobat pro, go to advanced/print production/convert colors.

    when the new dialog box opens, go to the checkbox which says "convert colors to output intent" and click it, and choose a greyscale conversion (which are the bottom options in the dropdown field there). make sure that the "preserve black" checkbox below is selected too.

    If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!
    Jongware
    Braniac
    July 13, 2010

    It's only an option when printing, and never has been in the PDF Export dialog.