Converting RGB to grayscale

I am acquiring an image and the output appears to be a grayscale image, but the text states that it is in fact an RGB image. I'd like to save some space and convert it into a GrayScale image. I have labview 8.2 and I don't have vision. Is there any way to do this?
Solved!
Go to Solution.
Attachments:
TakingImages3.vi ‏137 KB

Hi,
    Here is a almost solution, try if you can get best color, i am viewing black and white .
Best Regards,
Luis A. Mata C.
Ing. Electrónico
Anaco - Venezuela
Attachments:
RGB Image to GrayScale.vi ‏20 KB

Similar Messages

  • Is there a way to select every other page in a multi page pdf and convert it to grayscale?

    I'm going to ask this question in a few sub-forums, so if you think you've seen it, you might have.
    Where I work I use a program that can print to pdf. We use it to produce mailings, usually postcards, that are addressed.
    I often end up with a 500 page document that will print on 250 sheets of cover stock, which will get cut into 1,000 postcard, all pre-addressed and sorted by zip code.
    Usually, the address side is all black and the front is color. The printers we use can print a black click on the address side and a color click on the other, IF the pdf is set up that way. Otherwise, both sides will be counted as color clicks.
    I know I can select pages individually in a pdf and convert them to grayscale and those pages will be counted by the printer as black clicks, which are cheaper than color clicks.
    The problem is, I have not figured out how to convert all the odd numbered pages to grayscale at once. As a result, I usually end up printing the color side simplex, then putting the job back in the tray and printing the black side. Of course, that only works if only one side is personalized, sometimes both sides are.
    Is there a way to select every other page in a pdf and convert it to grayscale?

    The Acrobat SDK has sample code that shows how to convert the colors for one page (the first page of a document). This sample can easily be adjusted to process every other page. You can then use an Action that executes this JavaScript to process the document. Do you know how to create an Action? If so, you can use this script (as I said, adapted from the sample in the SDK) to convert all odd pages (1, 3, 5, ...):
    // Get a color convert action
    var toGray = this.getColorConvertAction();
    // Set up the action for a conversion to RGB
    toGray.matchAttributesAny = -1;
    toGray.matchSpaceTypeAny = ~toGray.constants.spaceFlags.AlternateSpace;
    toGray.matchIntent = toGray.constants.renderingIntents.Any;
    toGray.convertProfile = "Gray Gamma 1.8";
    toGray.convertIntent = toGray.constants.renderingIntents.Document;
    toGray.embed = true;
    toGray.preserveBlack = false;
    toGray.useBlackPointCompensation = true;
    toGray.action = toGray.constants.actions.Convert;
    // Convert every other page
    for (var i=0; i<this.numPages; i++) {
      console.println("Processing page " + i);
      if (i % 2 == 0) {  // change to "if (i % 2 != 0) {" for all even numbers
      console.println("in page " + i);
      console.println(this.colorConvertPage(i, [toGray], []));
    As I've indicated in the code, you can change this to all even numbers by changing the == to !=

  • Is there a way to select every other page in a pdf and convert it to grayscale?

    I'm going to ask this question in a few sub-forums, so if you think you've seen it, you might have. Someone suggested it might be done with Javascript. I know nothing about Javascript.
    Where I work I use a program that can print to pdf. We use it to produce mailings, usually postcards, that are addressed.
    I often end up with a 500 page document that will print on 250 sheets of cover stock, which will get cut into 1,000 postcard, all pre-addressed and sorted by zip code.
    Usually, the address side is all black and the front is color. The printers we use can print a black click on the address side and a color click on the other, IF the pdf is set up that way. Otherwise, both sides will be counted as color clicks.
    I know I can select pages individually in a pdf and convert them to grayscale and those pages will be counted by the printer as black clicks, which are cheaper than color clicks.
    The problem is, I have not figured out how to convert all the odd numbered pages to grayscale at once. As a result, I usually end up printing the color side simplex, then putting the job back in the tray and printing the black side. Of course, that only works if only one side is personalized, sometimes both sides are.
    Is there a way to select every other page in a pdf and convert it to grayscale?

    The Acrobat SDK has sample code that shows how to convert the colors for one page (the first page of a document). This sample can easily be adjusted to process every other page. You can then use an Action that executes this JavaScript to process the document. Do you know how to create an Action? If so, you can use this script (as I said, adapted from the sample in the SDK) to convert all odd pages (1, 3, 5, ...):
    // Get a color convert action
    var toGray = this.getColorConvertAction();
    // Set up the action for a conversion to RGB
    toGray.matchAttributesAny = -1;
    toGray.matchSpaceTypeAny = ~toGray.constants.spaceFlags.AlternateSpace;
    toGray.matchIntent = toGray.constants.renderingIntents.Any;
    toGray.convertProfile = "Gray Gamma 1.8";
    toGray.convertIntent = toGray.constants.renderingIntents.Document;
    toGray.embed = true;
    toGray.preserveBlack = false;
    toGray.useBlackPointCompensation = true;
    toGray.action = toGray.constants.actions.Convert;
    // Convert every other page
    for (var i=0; i<this.numPages; i++) {
      console.println("Processing page " + i);
      if (i % 2 == 0) {  // change to "if (i % 2 != 0) {" for all even numbers
      console.println("in page " + i);
      console.println(this.colorConvertPage(i, [toGray], []));
    As I've indicated in the code, you can change this to all even numbers by changing the == to !=

  • A black and white photo RGB or grayscale whats the best?

    a black and white photo scan it as RGB or grayscale whats the best?

    grayscale image would have smaller image size. And in Photoshop Elements you can always convert grayscale images to RGB.
    Thus I would advice to scan the photograph in grayscale.

  • How to solve this??convert CMYKBlack to grayscale

    Hi i need to convert CMYKBlack to grayscale.here is the code im using....
    in case of textart..
    if(style.fillPaint==1)
    if( style.fill.color.kind == kFourColor &&
    ((style.fill.color.c.f.black>0 && style.fill.color.c.f.cyan==0 &&
    style.fill.color.c.f.yellow==0 && style.fill.color.c.f.magenta==0) ||
    (style.fill.color.c.f.black==0 && style.fill.color.c.f.cyan==0 &&
    style.fill.color.c.f.yellow==0 && style.fill.color.c.f.magenta==0)))
    style.fill.color.kind=kGrayColor;
    percentageOfGray=0;
    percentageOfGray=(style.fill.color.c.f.cyan) * 30/100;
    percentageOfGray=percentageOfGray + ((style.fill.color.c.f.magenta) * 59/100);
    percentageOfGray=percentageOfGray + ((style.fill.color.c.f.yellow) * 11/100);
    percentageOfGray=percentageOfGray + (style.fill.color.c.f.black);
    if (percentageOfGray*100 >100)
    percentageOfGray=1;
    style.fill.color.c.g.gray=percentageOfGray;
    error = sAITextRun->SetTextRunPathStyle (line,&style );
    error = sAITextRun->SetTextRunPathStyle (line,&style )---------This syntax is used in illustrator 10 for setting the converted color..what is the similar syntax to be used in illustrator cs2.
    Please someone help me.......
    Thanks in advance......
    Subha.....

    Sorry, I've been sick for a few days, just got back. Hopefully this will still be useful to you (or someone else!).
    First, I just want to mention that there's a suite for doing this kind of thing, the AIColorConversionSuite (AIColourConversion.h). I'd take a look at that; it might simply your conversion code.
    As for setting the text colour in CS on, here's the code we use in our application for setting text's stroke colour:
    ------------- snip --------------
    ASSERT(sATEPaint);
    ASSERT(sAITextFrame);
    TextRangeRef textRangeRef = 0;
    // this code is inside an object that represents
    // text art, so it has a member that has the art
    // handle. This handle is retrieved using GetHandle()
    // so just replace 'GetHandle()' with your AIArtHandle
    // variable
    AIErr error = sAITextFrame->GetATETextRange(GetHandle(), &textRangeRef);
    THROW_EXCEP_IF(error);
    ATE::ITextRange textRange(textRangeRef);
    ATE::ICharFeatures charFeatures = textRange.GetUniqueLocalCharFeatures();
    // colour is a pointer to our own colour object; its
    // a pointer so that a 'null' stroke can be set
    if (colour) {
    ATE::ApplicationPaintRef paintRef = 0;
    AIColor aiColour;
    // this is the colour model of the document,
    // which is either CMYK or RGB
    EColourModel model = CDocumentList::GetCurrentDocument().GetColourModel();
    // we have classes, CRGBColour & CCMYKColour that automatically do
    // colour conversion for us -- they use the AIColorConversionSuite
    if (eColourModelRGB == model) {
    aiColour = (AIColor)(*colour);
    } else if (eColourModelCMYK == model) {
    aiColour = (AIColor)(CCMYKColour(*colour));
    error = sATEPaint->CreateATEApplicationPaint(&aiColour, &paintRef);
    THROW_EXCEP_IF(error);
    ATE::IApplicationPaint paint(paintRef);
    // obviously you'd use SetFillColor here if you wanted fill
    charFeatures.SetStrokeColor(paint);
    charFeatures.SetStroke(true);
    } else {
    charFeatures.SetStroke(false);
    textRange.SetLocalCharFeatures(charFeatures);
    ------------- snip --------------
    Note that THROW_EXCEP_IF is a macro of ours that throws an exception if error != kNoErr.

  • Converting RGB images (sRGB or Adobe RGB) to 709 color space.

    I'm trying to determine the correct way to convert RGB images (sRGB or Adobe RGB) to 709 color space.  I can't just use the "covert to profile" function to do this because it does not produce results that fall within the 16 to 235 range that 709 dictates.  I've read that you can simply use the "Levels" adjustment and change the output levels to 16 to 235.  While this would clearly compress the luminance to the correct range, I'm not entirely clear if the end result would be a proper conversion (i.e. if color and gamma, for example, would be technically correct.)
    I noticed that converting the profile to "HDTV (Rec. 709)" does alter the image, so I'm wondering what the result would be if I did both this AND used the levels control to compress the output range to 16 to 235.
    Thanks for any feedback on this.

    (1)
    http://en.wikipedia.org/wiki/Rec._709
    (2)
    http://en.wikipedia.org/wiki/Rec._601
    The transfer functions for Rec.709 (1) refer to the range [0..1] or for 8 bits per pixel [0...255].
    It seems that the clipping, black=16 and white=235 has to happen after the application of the
    transfer function. If this should be true, then we don't have a level compression but a level
    clipping at both ends, as already for Rec.601 (2), like here:
    The ICC-Profile HDTV(Rec.709) in Photoshop contains the primaries and the white point
    (both like that in sRGB) and the transfer functions for [0..1], coded by a LUT with high resolution,
    as found by Profile Inspector. There is no clipping.
    By the way, that`s the internal profile name, I don't know the file name of the profile.
    Softproofing, source in sRGB, target HDTV(Rec.709), without clipping:
    With numbers not preserved: no change of the appearance, as expected.
    With numbers preserved: shows the effect of different effective gammas. 
    Your questions are very clear and I'm not sure whether my comments help. The information
    in the internet is not convincing.
    Best regards --Gernot Hoffmann

  • Converting RGB PDF to CMYK PDF

    I'm looking for a way to convert RGB PDF's to CMYK PDF for printing purposes. The RGB PDF is created by an online Flash application and I'm hoping to convert the file using Acrobat via Command line. I have tried a couple of programs e.g. PStill and PDFcreator but these just don't do the job. It's important to use the command line due to the fact that the conversion must be done automatically on a dedicated server.
    Important to know is that the PDF consists of texts and images and gradients. This is a RGB example which I would like to convert. This is the CMYK output I have created manually.
    Other solutions next to Acrobat are also welcome as long as they do the job

    In your original message you say "the conversion must be done automatically on a dedicated server" - this implies that Acrobat is being used outside the EULA, which strictly forbids installation as a server process. Acrobat is licensed for individual interactive desktop use by one person, no other deployments are allowed.
    You cannot access Acrobat's editing and batch-processing functions from the commandline at all. Adobe has server-based solutions for PDF generation  (LiveCycle ES3) but they are extremely expensive and would need work to get them to do what you're looking for. Realistically, your Flash developer needs to recode his app to output in CMYK or you will need third-party software on the server to re-fry the files. I don't know of any off-the-shelf commandline tools which can perform color conversion on existing PDFs.

  • Converting symbols to grayscale

    I'm using the leaf symbol from the "nature" palette in the symbols library. Does anyone know of a way to convert this to grayscale, (picking filters/colors/convert to grayscale does not work) and/or to make it editable? thanks

    Object>Expand should work.

  • ICC profile to convert RGB to CMYK,   jpeg is ok, png format have a problem

    When I use ICC profile to convert RGB to CMYK, jpeg format is ok, but png format have a problem.the color is lossy.
    It means, the png file color is shallow than jpeg file after convert.Could anybody help me?
    thanks
    source code
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.util.Iterator;
    import javax.imageio.IIOImage;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageTypeSpecifier;
    import javax.imageio.ImageWriteParam;
    import javax.imageio.ImageWriter;
    import javax.imageio.metadata.IIOMetadata;
    import javax.imageio.metadata.IIOMetadataNode;
    import javax.imageio.stream.ImageOutputStream;
    import org.w3c.dom.Node;
    import com.sun.image.codec.jpeg.ImageFormatException;
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGEncodeParam;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    public class TestImage {
         public static void main(String args[]) throws ImageFormatException, IOException{
              BufferedImage readImage = null;
              try {
                  readImage = ImageIO.read(new File("C:\\TEST.jpg"));
              } catch (Exception e) {
                  e.printStackTrace();
                  readImage = null;
              readImage = CMYKProfile.getInstance().doChColor(readImage);
              writeImage(readImage, "C:\\TEST_after_.jpg", 1.0f);
        protected static String getSuffix(String filename) {
            int i = filename.lastIndexOf('.');
            if(i>0 && i<filename.length()-1) {
                return filename.substring(i+1).toLowerCase();
            return "";
        protected static void writeImage(BufferedImage image, String filename, float quality) {
            Iterator writers = ImageIO.getImageWritersBySuffix(getSuffix(filename));
            System.out.println("filename�F"+filename);
            if (writers.hasNext()) {
                ImageWriter writer = (ImageWriter)writers.next();
                try {
                    ImageOutputStream stream
                        = ImageIO.createImageOutputStream(new File(filename));
                    writer.setOutput(stream);
                    ImageWriteParam param = writer.getDefaultWriteParam();
                    if (param.canWriteCompressed()) {
                        param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);//NO COMPRESS
                        param.setCompressionQuality(quality);
                    } else {
                        System.out.println("Compression is not supported.");
                    IIOMetadata metadata = null;
                    if(getSuffix(filename).equals("png") || getSuffix(filename).equals("PNG")){
                         ImageTypeSpecifier imageTypeSpecifier = new ImageTypeSpecifier(image);
                         metadata = writer.getDefaultImageMetadata(imageTypeSpecifier, param);
                            String sFormat = "javax_imageio_png_1.0";
                            Node node = metadata.getAsTree(sFormat);
                            IIOMetadataNode gammaNode = new IIOMetadataNode("gAMA");
                            String sGamma = "55556";
                            gammaNode.setAttribute("value", sGamma);
                            node.appendChild(gammaNode);
                            metadata.setFromTree(sFormat, node);
                    writer.write(null, new IIOImage(image, null, metadata), param);
                    writer.dispose();
                    return;
                } catch (IOException ex) {
                    ex.printStackTrace();
    }

    Hi,
    I am having similar problems. I have read somewhere that png format can not handle CMYK colorspace anyway, which I find odd (and plainly stupid IM(NS)HO) which would mean that converting to RGB and therefore using profiles is mandatory.
    May be you should check if the internal format of the png files claims it is RGB or CMYK (using ImageMagick's "identify" command for example).
    HTH
    JG

  • Convert RGB to CMYK in AI

    Hi, my printing house said I sent him a RGB file and he needs CMYK for printing. 
    (1) How can I know the original file is RBG color mode?
    (2) How to convert RGB ai file to CMYK ai file?
    Thanks a lot!!!

    lhcheng,
    1) File>Document Color Mode.
    2) Tick CMYK instead of RGB.
    You should be aware that the RGB and CMYK colours are fundamentally different, so most likely you will have to create at least some colours anew, and you will have to accept certain inevitable changes.
    Many RGB colours will be changed to rather muddy and messy CMYK colours, as you can see in the Color palette when selecting CMYK.
    And many bright colours will become less so.

  • Is there as easy way of batch converting RGB files to CMYK in OS Lion?

    Is there as easy way of batch converting RGB files to CMYK in OS Lion?
    I was using a photoshop droplet on my desktop but this no longer works due to the fact it requires rosetta support.
    Thx P

    From another forum after googling:
    Your computer came with everything you need, because ColorSync can do that and Apple provided AppleScripts for it. Go to your Applications folder and look for the AppleScript folder. Double click on the 'Example Scripts' alias and then open the ColorSync scripts. Drag and drop your images on the the 'Match to CMYK' script.
    You can open AppleScript Editor from Launchpad (it's in Utilities). Go to Help to Open Example Scripts Folder. In the ColorSync folder is a Match application. Double click to make it run.
    Now you know what it does you may need to change it for batch conversion.
    Go to AppleScript Editor and open what you've just found. And I'm sorry that's as far as my knowledge goes, hope some one can fill in the gaps.
    Or you may just want to look at something like Graphic Converter?
    Regards,
    Colin R.

  • Convert RGB black to CMYK black

    PHOTOSHOP CS5
    I have a complex black-ink line drawing in large precentages of C, M, Y, & K. I'd like to somehow SELECT ALL PIXELS and zero out all but 100% K.
    I cannot figure out how to select all (nonbackground) pixels (no, Select>All does not accomplish) and then make them all 100%K, can you help?

    Yes, I need to end up CMYK. As you can see by my sample Photoshop converts RGB to crazy-high CMYK percentages. All I want these lines and text to be is 100% K.

  • Converting PDF to grayscale

    I am using Adobe CS 3, Acrobat 8 Professional, on Mac OS 10.4.11
    I am trying to convert a full color PDF document to grayscale. I tried to click Advanced > Print Production > Convert Colors and then Grayscale, but it is not working.
    I tried clicking Print and then choosing a PDF option, but it is taking unreasonably long and not finishing.
    So how can I convert it to grayscale?

    Hi,
    I had some trouble with this same issue of converting a color pdf to grayscale. I realized that in my particular pdf, just using the Tools/Print Production/Convert Colors function was not enough. Somehow there were extra spot colors inadvertently added to the file. Here are the steps to follow to make sure this works correctly if you are wanting to convert the entire pdf file to a grayscale image:
    (I am using Acrobat 7.0.9 on a Mac OS X, 10.4.11 system)
    1.) In your pdf file go to Tools/Print Production/Ink Manager click on the bottom left corner box that says (Convert all spots to process). Click okay.
    then
    2.) Go back to Tools/Print Production/Convert Colors. Click on (Device Gray: Convert) Action: Convert. Profile: Select your profile of choosing....for me it was 10% Dot Gain way at the bottom). Convert Pages: All. Conversion Options: Don't Embed Profile. Check box that says, Preserve Black Objects. Click okay.
    This should resolve any problems with those extra colors that will not convert to grayscale since they are assigned as spot colors.
    Hope this helps. Let me know if this works for anyone. just tried it once.
    Good luck!
    Janell

  • Hi, cannot convert RGB to CMYK...

    I cannot find such an option in the Elements? Can anyone help how can I convert the files to CMYK from RGB using this tool...
    Thanks
    ansu

    Elements can't convert RGB to CMYK. You'd need the full Photoshop.
    Otherwise you can google 'RGB to CMYK' conversion to find online or software tools that can do that.
    The real question is why do you need CMYK. If it's a request from a printer shop, it's their job and responsibility to do the conversion, since such a conversion can only be properly done when you know the specificity of your printing tools, inks and papers.

  • Color converting RGB to CMYK mode???

    Is it possible to convert RGB to CMYK color mode in Elements 10?

    No, not really. If you google around, Richard Lynch had a sort of workaround for this for very early versions of PSE that could possibly be adapted for current use, but a proper CMYK conversion is much more complex, even with the proper tools, than going from sRGB to Adobe RGB, for example.
    If you have a mac you can do a mode conversion in Preview, but you may not like what you get from the print shop using that method.

Maybe you are looking for