How to convert color tiff into black and white?

Hey guys, am new to JAI and need to convert a color tiff into black and white, I've gone through google and developed following code.
img = JAI.create("fileload","C:/eosimias.tif");
               newColorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_GRAY),new int[] {8},
                         false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
               pb = new ParameterBlock();
               pb.addSource(img);
               pb.add(newColorModel);
               img2 = JAI.create("ColorConvert", pb);
frame = new JFrame("Tiff study");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.add(new ScrollingImagePanel(img2, 400,400));
          frame.pack();
          frame.setVisible(true);When I execute the following program I get the following error
java.lang.IllegalArgumentException: The specified ColorModel is incompatible with the image SampleModel.
on the line frame.add(new ScrollingImagePanel(img2, 400,400));can someone please help me out with it.
Thank you in advance.

Check under Image> Mode and select 8 Bits / Channel  first.
Cheers,
Neale
Insanity is hereditary, you get it from your children
If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

Similar Messages

  • How convert a color pdf to black and white pdf...? new acrobat in creative cloud cs6

    how convert a color pdf to black and white pdf...? new acrobat in creative cloud cs6

    Print Production << where is this in XI...?

  • How to convert a coloured document into black and white pdf .

    I have to write a script in c++ to convert a coloured document into black and white pdf .can anybody help.

    You've posted on a forum dedicated to discussions of a resource center called the "Adobe Exchange" that has nothing at all to do with Acrobat.

  • Help! How can i print a color document in black and white?

    I have tried some of the other solutions found on Google but i still can not figure out how to print a color document in black and white on my macbook pro...can someone help me?

    One of the print dialogue options is for a black-and-white draft, for both Safari and Word.

  • How to determine actual colors in a black and white photo?

    I'm not sure if I'm in the right section, but I'm wondering if it's possible to use an Adobe program to restore actual colors in a black and white photo? I don't want add color by imagining or guessing; I need to determine the real colors. This might not even be possible, but if it is, please tell me what I can use.
    Thank you.

    That's where the artistry comes into play when they colorize old movies.
    A lady wears a nice dress:  is it greeen or purple?  It looks gray.
    A baby comes home from the hospital cute new baby clothes: pink or blue?  They look light gray.
    That's a nice school tie that guy's wearing: use the wrong colors on the stripes, and he's at a different school.  But they're nothing more than varying shades of gray.
    If there's one thing missing in a B&W photograph, it's any vestige of color information.   All you have is gray scale.   You may NEED to determine the real colors, but without a color photograph to use as a reference image, you're out of luck.

  • With hp officejet 6500a, how do you print a color webpage in black and white?

    With HP Officejet 6500A, how do you print a color webpage in black and white?

    Autogyro wrote:
    Charles Dyer wrote:
    Apple didn't make the drivers. Apple doesn't make printer drivers and has not done so since they stopped making their own printers. HP made the printer drivers for that device. Apple merely publishes HP's drivers.
    OK, but still, they built the poorly made HP drivers in their OS.
    Ah, no. They published the only drivers HP gave them. If they didn't publish them, then Mac users would be unable to use HP devices at all, except for those devices supported by 3rd parties such as Gutenprint and the HPIJS Project. HP is solely responsible for the state of their drivers. And it's not just Mac drivers which are bad; a lot of Windows drivers stink, too. HP simply has a problem writing drivers. For the most part they have excellent hardware, but truly terrible software.

  • Colored Pictures Turning Black and White in Certain Files (PSE 9.0)

    Hey guys, how's it going?
    I'll try to keep this breif, but it may take a little while to explain. I've been getting a problem with PSE 9.0 where an image or layer that is in color suddenly turns black and white when I paste it into an open file. It's a lot easier to explain with pictures, so here you go.
    Figure 1
    Figure 2
    (Before anything else is said, I would like to point out the reasoning behind relating a middle-finger, a hammer and sickle, and a pony from My Little Pony: Friendship is Magic into a single image; it's a parody project I'm working on. It's about 30 times weirder out of context, trust me.)
    As you can see, the source imagery with "APPA JAK" on it (figure 1) is in full color, but when I pasted it onto the layer with the hammer and sickle, it turned black and white. This has become the same with a few other images I have found, but I couldn't find any reliable way to recreate the problem. The problem is also the same weather I find the pictures from the internet, copy those to my clipboard, and paste them or simply paste them from my computer.
    If you need any more information (dxdiag, settings, etc. etc.) feel free to ask, and thanks in advance for helping me!

    Just a guess because I don't have the original images to play with, but the hammer and sickle is a grayscale image so images posted into it become grayscale. 
    Use Image / Mode / RGB Color to change the target image to color before pasting anything into it.
    Alternatively, use File / New to create a new image that is full color and paste everything into it.

  • Adding color to a black and white photo

    I've searched everywhere on here and on Youtube and can't seem to find how I can add color to a black and white photo using Aperture 3 that was taken in black and white.

    Hi, and welcome to the list. Make sure you read the [Help & Terms of Use|http://discussions.apple.com/help.jspa] section when you get a chance.
    It's not a good idea to insert a new question into someone else's post. First as you are not the originator of the post you can not assign solved or helpful ratings to any answers you get here. And the forum really relies on those to help other users locate meaningful responses.
    Secondly your question is less likely to get answered. readers of the post will be looking to either give advice on the original question or else be looking for answers to the question. A new question stuck in between the other replies is less likely to be noticed. It's always best to start a new thread and if something in another post applies you can always link to it.
    Now to your question. There was a great solution given to your very problem back a little while ago, see: [Topic : Black, white, and color?|http://discussions.apple.com/thread.jspa?messageID=12805425&#12805425]
    (see how I worked that last bit of advice into this post )

  • PSE 8: Color Tinting from Black and White Photo

    Basically, the title says it all.  Can someone tell me how to add areas of color in a black and white photo for PSE 8?
    I really appreciate it.

    Using Hue Saturation won't colorize my whole picture?  What if I just want to color a hat?  I mean, I know about hue/saturation and I know how to colorize.  But, how do you do it for something specific within that picture and leaving the rest black and white?
    Select what you want to colorize and then apply the colorization methods. You might want to first feather the selection 1 or 2 px to get a soft edge. As to Barbara's first method (painting on a blank layer with Color blend mode), the color tends to be washed out. If you want a deeper color, duplicate the layer and set its blend mode to Multiply; if the result is too dark then lower the duplicate layer's Opacity.

  • Bringing out colors on a black and white photos

    I just got Photoshop elements 11 for Xmas. I've been attempting to have a single color or object colored in a black and white picture. I have gotten as far as making a duplicate layer and then creating a mask but don't know where to go from here. How do you do this and is there an easier way to do this?

    For a colored original, get out the smart brush (the one with the gears on it), choose a black and white style from the popout menu in the tool options, turn on the Inverse checkbox, and drag over the object you want in color. The rest of the photo will turn black and white. The smart brush creates an editable layer mask, so no need to make one before you start.
    For a black and white original, select the area you want to colorize, then Layer>New Adjustment Layer>Hue/Saturation, turn on the colorize checkbox and adjust the sliders to get the shade you want.

  • Add a touch of color to a black and white photo?

    In Aperture how do you add a touch of color to a black and white photo?

    Ledted wrote:
    easiest way is to spend $1.99 on Color Splash Studio from the App store.
    Can you confirm that Color Splash Studio allows one to _add_ a hue to a grayscale image?  I asked their support, and got this answer which seems to say that one cannot add hues other than sepia or blue (cyanotype simulation is my guess) to grayscale images:
    Regarding your questions: the app can add hue in color photography, but when in grayscale mode, you can adjust brightness, contrast, blur and amount. Also, our monochrome layers include grayscale, sepia and blue tone, so you can choose.

  • Determining colors in a black and white photo

    I don't know if Photoshop can do this, but I really need to bring color to a black and white photo. I'm not looking to add color by imagining or guessing; I need to find out the actual colors. Is this possible? If photoshop can't do it but another program can, please let me know.
    Thank you.

    Just for interest sake, make a screen grab of your swatch panel, and paste it into a new Photoshop document.  Add a B&W adjustment layer, and have a think about what colour each shade of grey represents.  You can turn the B&W adjustment layer off and on again to help you along.

  • Adding color to a black and white image

    How do you add a splash of color to a black and white photo? I have this beautiful picture of my daughter in a ballet tutu and I would like the pic to be black and white and her leotard to remain pink.

    To colorize a B&W, please refer to my reply in the recent forum topic "Photo Elements 6.0 question" :  http://forums.adobe.com/thread/492539?tstart=0

  • How can I print with the black and white cartridge only?

    I am trying to print using the black and white cartridge only because magenta is out of ink but I'm getting the following error message in HP Photosmart C7200 series print dialog:
    The printer is out of ink.
    The following ink cartridges are empty: Magenta. Replace these ink cartridges to resume printing.
    How can I print with the black and white cartridge only?
    Mac OSX 10.7.3
    HP Photosmart C7280 (7200 series)
    This question was solved.
    View Solution.

    I am absolutely disgusted by this; clearly a scam from HP to make more money by selling extra ink cartridges!!  I will make sure to never buy any products from the shoddy rip off merchants at HP ever again!!
    You should be ashamed!!

  • How do your turn off the "black and White" setting for the visually impaired?

    How do you turn off the "black and White" setting for the visually impaired?  Also known as the "tripple Click"

    Settings>General>Accessibilty>White on black--> Off

Maybe you are looking for

  • Error in BAPI_SALESORDER_CHANGE

    I need to post the changed incoterm value by using BAPI_SALESORDER_CHANGE. But everytime I used to get the error: Field header_inx-updateflag is not an input field. I have written the below mentioned code :  *& Report  ZBAPI1                         

  • Add simpleviewer photo gallery to page

    I created photo galleries with simple viewer & Porta and I can't figure out the easiest way to add those galleries to my website. I usually create each new page from my default template page which has the "editable regions" that you put in to add tab

  • How to set ref_to_message_id in the abap proxy

    Hi, Does anyone have idea, how to set ref_to_message_id of a client proxy in the server proxy? My problem is, I send a message to a server proxy. The server proxy receives the message, retrieves the message id and tries to set the ref_to_message_id o

  • Journal Preview fires FORM_DATA_ADD event

    Hi I've got some code behind the FORM_DATA_ADD within the FormDataEvent which opens a new form once the user adds a new delivery. The problem is, is that the FORM_DATA_ADD event also seems to be thrown when clicking on the Journal Preview button befo

  • Is it important to use INITIAL SIZE 0 in internal table

    Hi Friends, I want to know, is it important to use INITIAL SIZE 0 in the time of internal table deceleration. TYPES:       BEGIN OF L_TYP_TAB_VBELN,                      VBELN    LIKE VBAK-VBELN,                        END   OF L_TYP_TAB_VBELN. DATA: