Converting to grayscale?

Hi,
I'm doing an experiment and as preprocessing would like to convert my set of PNG images into grayscale using the following ratios
New pixel value = .31R + .59G + .10B
While I'm experienced in Java and server side apps, I've never done much client work. The vast area of java.awt.image classes are at the moment a bit inaccessible.
Can someone recommend the current (1.4) way of doing this? I'd really like to use my grayscale ratio rather than the default grayscale ColorSpace (though it'd be nice to know what ratios it uses, too).
Any tutorials/books/links would be appreciated, too! Thanks!
- Everett

...just to note, the paper that I'm implementing for a class project says the following on its conversion:
"In the preprocessing stage each COIL image I = (R, G, B)
was first transformed into a gray-level image E through the
conversion formula
E = .31R + .59G + .10B,
rescaling the obtained gray-level in the range between
zero and 255."
"Support Vector Machines for 3D Object Recognition"
Pontil & Verri, 1998
I'd be happy to also know how in 1.4 to convert to grayscale in general! :)
Thanks,
Everett

Similar Messages

  • Word docs with bitmap drawings converted to grayscale

    I'm still using Acrobat/Distiller 5 on Windows 2000 Pro to prepare press ready PDFs of word 2000 docs with black & white line drawings (600 dpi bitmaps). I've always used the default "Press" job option file and simply printed to the distiller printer that is installed with Acrobat. Been doing this without any problems for years. I had some computer problems recently and had to change to a different machine. Now when I print, the resulting PDFs have those 600 dpi bitmaps converted to grayscale images. I've tried every setting I can think of to make it go away. Like I said, I've never had to change anything from the default job options file. I've tried printing the postscript to a file, then distilling, always the same. BTW, fonts look good. I know there is a solution because this same thing popped up 2 or 3 years ago and it got solved then, but I can't figure it out this time. Nothing has changed wth the docs, but a new install of Acrobat on different hardware, same OS. Help please -deadline looming.
    Thanks, Dave

    To all those having trouble converting documents to pdfs, I did some research and found a work around.
    Go to File and choose Save & Send. Then choose Create PDF/XPS document. Click the Create button. PDF is generated.

  • How to convert illustrator file containing a photograph to grayscale when the "convert to grayscale" option is grayed out?

    It's been several years since I've done any design work at all. I recently got a job as a designer, and on my first day I had to create an ad in illustrator 5.5 (required to be in illustrator) for print in a black and white publication. There was even an ad template to use. I placed the photo and tried to use the "convert to grayscale" option but everything under the edit colors menu was grayed out. I know it's because of the photo. In the end I changed the photo to grayscale in photoshop and replaced the image, but I know there is another way around this. Can someone please help me figure out how to fix this issue?
    Thank you so much in advance!

    If the placed image is linked, Edit Colors will not allow conversion to grayscale; however, an embedded image will work just fine. The flyout menu in the Links Panel allows you to embed the image.
    Peter

  • Convert to Grayscale fixups changes weight of rule from 2 pt. to 1 pt.

    Convert to Grayscale fixups changes weight of rule from 2 pt. to 1 pt.
    If I Print to Grayscale it works fine.
    Any ideas?

    Can you be more specific - can you reproduce the result with different variables? (Create a new document)
    What version of Acrobat, including update level  (ie; AA Pro 9.5.1)
    What Operating system?
    Are these line strokes or frames to a polygon?
    What authoring software?
    Can you host the file such that someone else could attempt the same fixup?

  • Error Message When Converting to Grayscale in Adobe 9

    When I convert a PDF to grayscale via Advanced/Print Production/Preflight all of my pages have the following text printed on the top: All problems according to Preflight profile Convert to grayscale.
    Does anyone know how I can get rid of that?  The conversion works great but I don't want that text included.
    Thanks in advance!

    Thank you for your response. These forums are specific to the
    Acrobat.com website and its set of hosted services, and do not
    cover the Acrobat family of desktop products. Please visit the
    following forums for any questions related to the Acrobat family of
    desktop products:
    http://www.adobeforums.com/cgi-bin/webx/.3bbeda8b/

  • CS4: Convert to Grayscale grayed out

    Trying to convert an Illust. CS4 document to grayscale using the manuals steps: Choose Edit > Edit Colors > Convert To Grayscale. However, all those options under Edit > Edit Colors > are grayed out (ironically ;^). I assume I have to convert something first, but what? Thanks!

    >Convert to Grayscale grayed out
    Oh, man... That's right up there with the timeless NY Post headline, "Headless Body in Topless Bar."
    I'm sorry, I can't comment further. I'm at AI 12 (CS2), which does not have that feature.

  • How to convert from Grayscale to single color channel

    I hope that someone here might be able to help. I am writing an application which loads in color channels separately, to be merged by the application The images are multi-page TIFF files. The trouble that I am running into is that the application loads the images into grayscale, so when I merge the channels, they are merged as grayscale, not as the correct colors.
    I use the following on each color channel to load them in:
    public static BufferedImage[] loadTiff(File multiPageFile, int colour) {
        BufferedImage[] img = null;
        ArrayList<BufferedImage> tmp = new ArrayList<BufferedImage>();
        try {
            SeekableStream stream = new FileSeekableStream(multiPageFile);
            String[] names = ImageCodec.getDecoderNames(stream);
            ImageDecoder dec = ImageCodec.createImageDecoder(names[0], stream, null);
            int numPages = dec.getNumPages();
            for (int i=0; i<numPages; i++) {
             try {
                    RenderedImage im = dec.decodeAsRenderedImage(i);
                    BufferedImage bi = PlanarImage.wrapRenderedImage(im).getAsBufferedImage();
              //In case not all pages are valid images, we use ArrayList as it is dynamic
              tmp.add(bi);
                }catch (RuntimeException re) {
              //Once the exception is caught, we can decode the layer here for whatever means.   
        }catch (FileNotFoundException fnfe) {
            System.err.println("File not found.");
            fnfe.printStackTrace();
        }catch (Exception e) {
            System.err.println("General Exception caught");
            e.printStackTrace();
        //Convert to an array to be returned.
        img = new BufferedImage[tmp.size()];
        for (int i=0; i<img.length; i++) {
            img[i] = tmp.get(i);
        return img;
    }So a BufferedImage array is returned (one element in the array for each page in the multi-page file). Before I return the BufferedImage array, though, it would be good to convert it to the correct color. I know which channel is currently being loaded. Does anyone have any tips on how to shift from a grayscale intensity to a single color intensity? I have tried a number of things regarding byte shifting, but I am really none the wiser.
    I have tried, for example, reading the int color value:
    int color = bi.getRGB(w,h);The trouble is that this number is not in the region 0..255, so I don't know how I can use it. If I shift the number:
    color = color>>16I get a number smaller than 255 (although it seems to be negative), but I don't know whether I can use this value for a single color channel, i.e. if the current color is red, saying:
    Color redC = new Color(color, 0, 0);
    bi.setRGB(w,h,redC); //Slow and inefficient. There must be a better way.When I try doing that, I end up with nothing drawn or visible.
    Does anyone have any ideas? Thanks in advance.
    Edited by: doughnuts64 on Jun 12, 2008 6:27 AM

    Thanks for the response. It has been helpful in getting my problem sorted. I was not creating a new BufferedImage - I was just using the one that had been loaded in, and as such had not realised that the type was not TYPE_INT_RGB. As soon as I instantiated a new BufferedImage of the same dimensions and colour TYPE_INT_RGB as you suggested, it worked! So thanks for that.
    Whilst that does work, it does slow the application incredibly as it has so much data to cycle through. Ideally, I would be able to load the image in directly as the colour channel in question, rather than loading in as grayscale. This way, the application would only require the amount of time needed to load in the images, not to process them on a pixel-by-pixel basis (typical images are made up of over 16,000,000 pixels for each colour channel, and we typically load two files in at once - both for separate colour channels, so over 32,000,000 pixels to process).
    As I am loading in multi-page tiff files, I am having to use the JAI (Java Advanced Imaging) toolkit. I use the following code to load in my multi-page tiff into a BufferedImage array, where each element of the array represents one of the 'pages' in the multi-page tiff file:
    SeekableStream stream = new FileSeekableStream(multiPageFile);
    String[] names = ImageCodec.getDecoderNames(stream);
    ImageDecoder dec = ImageCodec.createImageDecoder(names[0], stream, null);
    int numPages = dec.getNumPages();
    BufferedImage[] finalImage = new BufferedImage[numPages];
    for (int i=0; i<numPages; i++) {
         RenderedImage im = dec.decodeAsRenderedImage(i);
         finalImage[i] = PlanarImage.wrapRenderedImage(im).getAsBufferedImage();
         //...colour changing code currently here - loops through finalImage array, and on every pixel of every layer
    ...To be able to automatically convert the colour channel without having to loop on every pixel (and thus save an incredible amount of loading time) would be helpful.
    Thanks.

  • Convert to grayscale.

    I have a color illustration in Pages, iWork '09. How do I convert the image to grayscale or Black & White?
    Thanks in advance,
    Lenny.

    Black & White
    You do not want to match to black and white. In terms of technical prepress, you are matching to 1 bit so you are flattening tonal detail. The result is not recognisable.
    I convert the image to grayscale
    Here you are matching from lightness, chroma and hue to lightness and you have tonal detail left. To do this match to the image on disk, open the image in the ColorSync Utility, select Apply Profile in the first drop down dialogue, select Abstract (for the ABST Abstract class of ICC profile) and select the canned Gray Tone ABST Abstract profile that is also available in the printing dialogue. Depending on what you have installed on your system, you may have PRTR Printer device profiles that match to grayscale. These will appear if you open the drop down list termed Output.
    If you don't want to permanently change the pixels in your picture on disk, you can place the picture in Pages and change the pixels in the placed version (Pages does not link to the picture on disk but embeds the picture and applies edits to the embedded version). Finally, if you neither want to permanently change the pixels in your picture on disk or permanently change the pixels in placed copy of your picture (the copy that Pages embeds), then you can change the pixels only in the print stream by applying the ABST Abstract profile in the print dialogue.
    (You will find that no two software suppliers supply the same names for the same classes of ICC profile or the same names for the positions of ICC profiles in colour matching sessions. But you'll learn to live with that -:)).
    /hh

  • Acrobat 9 convert to grayscale

    How do I convert a PDF to grayscale in Acrobat 9 Standard for Windows?
    I see all kinds of tips for Mac, Pro or Extended. But I don't see any such options on on my menus or configs.
    thanks!

    HTML by its very nature has a varying format to meet the needs of the browser and screen. It should never be expected to see the same format when converting to HTML. Actually I am surprised you could even convert it to HTML since most IRS forms are secure and do not allow such operations. If you want to post it to your site for some reason, just post the PDF file itself.

  • Edit Edit Colors Convert to Grayscale Not working

    In Ai CS6 when I select all and try to convert to GS nothing seems to happen. I still have a RGB/preview and if I go back to the edit colors menu, convert to cmyk is still grayed out, suggesting that the art is still 4c. Thanks for your help!
    Jon

    jaal,
    Illy refuses to convert RGB to CMYK and CMYK to RGB, therefore the opposite is greyed out.
    So you are in RGB mode.
    Is there any RGB vector artwork that is non grayscale?
    If there is, it may be time for the list.
    The following is a general list of things you may try when the issue is not in a specific file, and when it is not caused by issues with opening a file from external media. You may have tried/done some of them already; 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save current artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to at least 5 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible), for CS3 - CC you may find the folder here:
    https://helpx.adobe.com/illustrator/kb/preference-file-location-illustrator.html
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall (ticking the box to delete the preferences), run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • Cs4 converting to grayscale

    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!

    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[i].hasOwnProperty("baseColor") || app.activeDocument.swatches[i].hasOwnProperty("gradientStops")))
      swatchlist.push(app.activeDocument.swatches[i]);
      namelist.push(app.activeDocument.swatches[i].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];

  • How do you convert a PDF to grayscale?

    Just switched from Pro 8 to 9.  In 8 I would use the convert colors tool to do this but it didnt always work but I delt with it.  Im on Pro 9 and the settings for that have all moved around.  I never really fully understood how to convert a PDF to grayscale, would just wing it as it was.  Now Im totally baffled.  Is there any "proper" way to convert to grayscale where I dont have hundreds of options to go through with profiles and other things that are really over my head and needs?

    Thanks guys(or gals?) to responding to this.
    What I ended up doing is:
    Covert entire file to grayscale.
    Save As "file name + BW"
    Close
    Open original file
    Replace individual pages from BW version for each page I want to change to BW.
    BTW:
    The reason I need to do this is to avoid getting color click charges on my printer/copier. The original pdf is created in Microsoft Publisher(Yuck!), then made into a Color PDF. Some pages only need to be printed as B/W, and others as Color. This can be also be done using an advanced controller such a Fiery on the printer/copier, but that would cost an additional $3000, and it would be used just for this functionality. With this route, it will only be just the cost of Acrobat Pro.
    Also, I am doing this on Acrobat for the Mac, which seems to have the same issues as the Window version.

  • Converting colors to monochrome black (not to grayscale) Pro X

    Hello everyone, I'm trying to convert the colors in a PDF to monochrome black (black, black, and only black, not grayscale wanted!!!), but I only find how to convert in grayscale... I'm using Pro X and I don't have and can't have any other software at work..
    I have not any knowledge about design/prepress.. I learned to use Acrobad Pro X by myself, and with the Web.. but, I'm convinced there must be a way to do it ?!?
    The situation: having over 50 AutoCAD ".dwg" files..
    In Windows Explorer, selecting all .dwg files, right-click and choosing "combine supported file type to Acrobat"
    (... Selecting the layouts and/or model, and options I want than waiting for the conversion ...)
    The created PDF file (default name when saving is Binder1.pdf) is in color, as the drawing is in color too.
    If I preflight / fix-up / convert to grayscale, it will print in grayscale, but some gray is too pale, barely visible on paper.
    Like the "plot color style table / pen assignment" in AutoCAD, I'm looking for a result like "monochrome.ctb", not the "grayscale.ctb"
    [ For those who know how AutoCAD works, it can be long and fastidious to open up each single file and plot it.. unless anyone of you knows how to bacth plot a bunch of different files, all on the same plot style/profile/ctb.. cause we're 3 professional drafters here and except for freewares still prohibited at work, no one knows how to do it beside coding - or trying to code - some script!! - but anyway, it's not the purpose here, so... ]
    Well, I'm sure there is a way to do it in Acrobat, would be very usefull for me for other work purposes, but I just can't find how to do it.. Tried a lot of things, spent 2 hours reading forums/blogs, but didn't find what I was looking for, or maybe  I'm useless today lol.. Anyway, if anyone knows the way, you'd make my day (and 4 weeks too) !!!!
    *Excuse my English.. second language!

    Oh ! Thank you again ! Finally, got it !
    Actually, I had to try on a little bit of things before succeeding. Well you know, I had created the fixup, but couldn't find it back, etc. Anyway, finally got it !
    I had to modify it a little bit, by adding a second set of values for RGB, it wouldn't work with only CMYK, don't know why.. By deduction, I tried values, and it worked. I couldn't have only "convert to spot color" in the list, there was still others fixups.. Well, the point is I couldn't find just a single "convert to spot", seems like I had none?! Here's the printscreen ..
    So the result is good considering that some lines are thinner than others, they seem to be in gray at first, but when looking further (or zooming in) I can see they're really in black, they just print thinner as the pdf made from autocad had specific lineweights (property from autocad).
    Thank you very much again!!!

  • 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.

  • Converting color .jpg image to grayscale

    I have a color .jpg image that I want to convert to grayscale and then add annotation. Is this easy to do in Illustrator?

    Thomas Crowley wrote:
    I've opened the .jpg image in Illustrator. It is a line drawing.
    Those two statements constitute a logical fallacy. A JPEG image is a bitmap, and not, in any way or fashion, a "line drawing". Therefore,
    ...I cannot edit individual parts of the drawing.
    is because the "individual parts" of the image are single color pixels. To "edit" these, you need a bitmap editor.
    It's necessary to say "edit" (w/quotes) because you will be editing pixels. Any notion of 'lines', 'planes', and 'shades' only exist in your mind, and not as physical separate objects somewhere inside the bitmap. If you think you can "select" a big black square "object" in the bitmap editor, well, that's because the software only makes you think you can (it's easy to scan for the edge of a single color filled region).
    ... I just felt you might need to know this.

Maybe you are looking for

  • Failure to Register Error

    I have tried to install Flash Player 8 ActiveX and received the following message during installation: Error 1904.Module C:\Windows\system32\macromed\flash\flash8.ocx failed to register. HRESULT -2147220473. How can resolve this problem with installa

  • Autofs timeout while accessing to remote NFS mount

    Following Apple recommendations, I switched to "Directory Utility" to configure NFS mounts. As far as I understand, if you do so, the mounts are handled by automount which is itself called by autofs. The good thing of this is that autofs is unmountin

  • *** URGENT *** Problems Connecting to MS SQL Server 2000

    Hi guys, I'm rather new to SQL Server and whenever I try to connect to my tables in SQL Servers through jdbc-odbc bridge and ODBC DSN it's Ok. BUT when I try the Microsoft or Merant driver I get log in problem. The server requires a trusted connectio

  • Help with selecting 10 random records from all records meeting report selection criteria in Crystal 11

    <p>I am trying to select ten random records from all that match the report selection criteria then report on each of these random records for QA/QI.  I have tried the RND function however it is giving me a random number rather than a random record se

  • Network Security Groups - Internet

    Hello, I am implementing NSGs in an Azure environment. When i apply a Deny Any Internet on the Domain controller Subnet (2 DC), i am not able to login with RD Web access anymore (DMZ has internet allowed). After the Deny Any Internet is an Allow Any