JAI - Colour problem converting GIF to JPEG

Hi
I'm using JAI to load a GIF, and then save it as a JPEG. When I save it (using the "filestore" operation in JAI.create(...) the resulting JPEG seems to be monochrome. However if I save the same image as a BMP, it's fine.
I think this has something to do with ColorModels, but I'm a bit lost and confused really. Please could someone point me in the right direction?
NB, because I can't get ImageIO installed on my machine (it refuses to believe I have the right JDK installed...) I'm restricted to methods available in JAI
Thanks

Thanks for the reply. Here's the complete solution for anyone whose interested (mostly copied from another post). I tested it and it works a treat for my app at least
(image is a RenderedOp)
BufferedImage realImage = image.getAsBufferedImage();
try{
BufferedImage rawImage = realImage;
    realImage = new BufferedImage(rawImage.getWidth(), rawImage.getHeight(), BufferedImage.TYPE_INT_RGB); //CHANGE THIS TO TYPE YOU NEED
    ColorConvertOp xformOp = new ColorConvertOp(null);
    xformOp.filter(rawImage, realImage);
}catch(Exception e){
    e.printStackTrace();
}

Similar Messages

  • Mail is converting gifs to jpegs

    All of the sudden my Mail program is converting all of my gifs I attach to jpegs. Can someone tell me how to prevent that?

    I was dragging them and also using the Attach button in mail.
    I have figured out however the problem is in the bottom right hand corner of the composing screen where it says image size. Somehow along the way it got set to medium instead of actual size hence reducing my gif animation to a jpeg. Thanks for your reply

  • How can i convert .gif/.bmp/.jpeg file to labview code(vi)?

    Hi,
    I am having a .gif file which consists of vi code. I want to convert that .gif file into vi & complile it. I am using LV 6.1 & 7 express. Is is possible?
    Reverse is surely possible like we can convert the vi diagram into .gif/.bmp file? But above i dont know?
    Your help will really appreciated.
    Best Regards,
    Nirmal

    If I understand your desire, it's to be able to convert a graphical image (bit map or screen photo, for example) into a functional block of LabView code, with all of the wire work done, etc. This is a task approximately equivalent to performing optical character recognition.
    In the case of a non-system subvi, unless that subvi is loaded, so that it's graphical representation can be recognized by comparing the bit-map image for the subvi on the photo with the available vi's.
    Another difficult problem to solve is when the bit-map has been scaled up or down, such that there's a pixel count mismatch between the VI iconic bitmap and the photographic bitmap you wish to import into your code diagram.
    And if you try to do recognition on objects that have h
    ad their RGB color representations changed, as can happen when JPG compression or other compression forms are used that reduce to total number of colors saved, that challenges the object recognition further.
    Also, what you're interested in having is only of value to Labview programmers, so there's not a very large market for such a tool to be sold to - unlike bitmaps of scanned text to ASCII or wordprocessor applications - traditional OCR software.
    All this ins't to say it can't be done, but that it's difficult, and for the person or company that undertakes it, the sales potential is limited.
    Regards,
    Bob Donnell

  • Convert GIF to JPEG

    Can anyone recommend a free software program that will convert some GIF photos to JPEG's? Thanks for your help.
    iMac G5   Mac OS X (10.4.3)  

    Open each GIF in Preview, which is located in the Applications folder, choose Save As from the File menu, choose JPEG as the format, and click Save.
    (21183)

  • Converting Tif file to GIF or JPEG

    Could you provide me with an example to convert a TIF file to GIF or JPEG with the JIMI or tell me of a good link where I can learn how to do this?. I downloaded the JIMI library but I cannot find documentation or a clear example to carry out this conversion.

    Do you know how the JIMI converts multi-paged TIF files into several JPEG or GIG files? The Jimireader could read only the first page of a TIF file. But I could not get the other pages of the TIF file. The code that I wrote to extract the first page was:
    try {
    JimiReader reader= Jimi.createJimiReader"C:/MRFleSto/4.tif");
    i = reader.getNumberOfImages();
    java.awt.Image img = reader.getImage();
    .... more code to put the image in a call to convert it
    reader.close();
    } catch(Exception e){}
    It turns out that i (the number of images) returns -1; never the total number of pages in the file. Also the getNextImage method of the JimiReader is "protected" (that is, removed from the class) and cannot be used.

  • Converting From GIF To JPEG...

    Alright gang, I've got a pic in .gif format and want to convert it to .jpeg. iPhoto tells me to change it with another application, but doesn't tell me what? Any ideas?
    Normally, in the world of PC's, I'd just convert it using MS's Paint program.
    Anyone?
    Bob

    HI Bobby,
    In your Applications folder there is a program called Preview. If you double click on an image file, Preview is usually the default application that will open it.
    Once opened by Preview, do a "save as" and choose jpg as the format.

  • I'm using OSX 10.7.4 how do I convert gif files to jpeg? Preview does not have a "save as" choice.

    I'm using OSX 10.7.4 how do I convert gif files to jpeg? Preview does not have a "save as" choice.

    GraphicConverter (the best shareware ever devised for the Mac) will do this for you:
    http://www.lemkesoft.com/

  • Dynamically convert swf to jpeg/gif format

    hello,
    I need a help to dynamically convert swf to jpeg/gif format
    using java/jsp
    this feature is implemented in php in the below URL
    http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php
    Thanks and regards
    Namratha

    You need to go here:
    Screen
    Cap Using Flash 8 and PHP
    It is exactly what you need.
    Walter
    And you can kiss the ground and thank God above that I was
    able to point you to this, it took me months to find!!!

  • Converting GIF images to JPG - display problems in browser

    I am currently writing a program that uses the ImageIO package (javax.imageio.*) to take GIF and PNG images and convert them to JPG images. The program seems to convert them correctly, especially for the PNG images, but the converted GIF images don't open in a browser. They open just fine in Windows Picture and Fax viewer, but when I try to open them in IE or Firefox, it only diplays the little red 'x'.
    Is anyone familiar enough with Images and the ImageIO package in Java that they may have some insight on why these converted GIF files won't display in a browser.

    Bonjour,
    In my [website|http://iweb.debutersurmac.com>, all the images are JPG files,
    By default iWeb '09 converts images to JPG (yes, it's true)...
    ...unless you use masked images*
    !http://i32.servimg.com/u/f32/09/02/44/99/masked10.jpg!
    Crop your images (with Preview) before you paste them in iWeb. Don't use mask, Unmask an image if it's masked. That's the trick!
    !http://i32.servimg.com/u/f32/09/02/44/99/unmask10.jpg!
    (* images with transparency areas (ex : some PNG and GIF), rotation and shapes in iWeb make also PNG files in your website.)

  • How do I convert file to gif, jpg, jpeg, png, bmp, or swf

    I mad a page in COMIC LIFE. I saved it, then when i went on photobucket.com, it gave me a message saying
    The file "" does not have a valid image extension.
    Valid image extensions are: gif, jpg, jpeg, png, bmp, swf.
    HOW DO I CHANGE IT?
    Thanks

    I have never used Comic Life, so I can't tell you how to do it from there. But you could open it in Preview. Control-click the page in the Finder and choose Open with... set it to Preview. Once in Preview, do a Save As and change the Format there.

  • I am having problems converting raw files to jpeg for printing. I am using 90 quality, 300 resolutiong, srgb, no sharpening and no resizing.  when u print to meijer the pic are a little grainy.  can soneone pkease helo me understand what settings to use?

    When I take my cd to meijer to print the pic are a little grainy.  Not as crisp as they look on the computer. When I convert raw to jpeg I am using 90 quality 300 resolution, no resizing no sharpening, srgb. Can someone please help me understand what setting to use for printing. I want to be able to out my pic ok on a cd and take them to get prints.

    kann527 wrote:
    I am new to this so I am not sure what the file size is since I'm not resizing it.
    The question asked about exported image size (height and width) in pixels, not file size. Your operating system can tell you, or if you import the exported image into Lightroom, then Lightroom can tell you in the Metadata Panel, set the dropdown to EXIF.
    I am printing a 5x7. I know I have tried to print with long edge set at 1024 and set to 300 ppi and had the same result with the grainy ness.
    If the exported file has a long edge of 1024, then you did resize the image, there no other way to turn a RAW in to a JPG with long edge 1024. In any event, 1024 pixels is probably not large enough to fill 7 inches, that's really 1024/7=146 pixels per inch (rounded-off), and could be the cause of the "graininess" that you see, although I would use the word "pixelization" to describe what you see. So I'm not sure we are talking about the same thing, but let's go with it for now.
    The solution depends on your answer to the original question, and probably depends on a clarification of how you got the image to 1024 on the long edge even though you claim you didn't resize it.

  • Creating GIF or JPEG files

    Is it possible to render a graphic object into a GIF or JPEG file and save it in a Java application?
    Thanks.
    Pradeep Gupta
    518-383-1167
    [email protected]

    For JPEG:
    1) Try JAI (http://java.sun.com/products/java-media/jai/) or the Java Image I/O from JDK 1.4.
    2) Try PJA (www.eteks.com)
    There is a pitfall if you want to do imaging in a Unix/Linux machine and the Java program can not access a X Server (maybe the machine is not running X). In this case you must install a "fake X Server", or use PJA.
    For GIF:
    Due to LZW patent problems with GIF compression the packages that generate GIF files have(had) to get a Unisys license.

  • Multiple Upload Image Problem - Resize GIF files

    The Multiple Image Upload script seems to handle .jpg images without problems.
    However, .gif files return the error:
    "Error converting image (image resize). Image processing library not available or does not support operation. (imagemagick library is not working or not found)."
    The problem is caused by the fact that script that I'm using tries to pass a parameter that is not valid for gif processing:
    myimage.gif' '-quality' '80'
    The "quality" parameter works only for jpeg and .png files as described here:
    http://www.imagemagick.org/script/command-line-options.php#quality
    Please ensure that the script makes difference between .gif and .jpeg files and use the correct parameters so we can resize the images properly.
    Thanks in advance,
    Márcio

    Hi Marcio,
    >>
    Can you tell me the inconveniance of using GD instead of Imagemagick, or its, shortly similar?
    >>
    sorry, but never worked with ImageMagick so far, so I can´t compare
    >>
    The "quality" parameter works only for jpeg and .png files as described here
    >>
    yeah, it seems that this is a small bug in ADDT´s "includes/common/lib/image/KT_Image.class.php" file. Was just checking the code in there, and indeed it adds this extra parameter regardless the image type -- but I do have an idea how this file can be modified to not use this parameter if the file in question has the suffix ".gif".
    If you feel a little adventurous, I´ll happily invite you to modify some code in this file -- please let me know if you´re ready for some instructions. However, if so, please make a backup of this file first...
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Problems creating PDF from JPEGs.

    I am using Acrobat Standard 6.0.5. I am having trouble creating a PDF from certain JPEGs. I created these JPEGs using a scanner and Photoshop Elements 5, saving them as 8-bit grayscale at 300dpi. When I create a PDF from these JPEGs in Acrobat, I get a blank, 1 inch x 1 inch image. I've tried zooming in and out and the image is still blank. The funny thing is that I can extract the JPEGs from the newly created PDF, so they are somehow present; I just can't see them.
    Some other data points:
    1. I can create a PDF from JPEGs from my digital camera. These are 180 dpi, 24-bit color, but otherwise I don't see any notable differences.
    2. I've tried converting the problematic JPEGs to 24-bit color. That made no difference.
    3. I've tried converting the problematic JPEGs to JPEG2000. That *did* make a difference -- I can create a PDF from them just fine.
    4. I can open the problematic JPEGs in Photoshop Elements and *print* them to PDF. That works just fine.
    There's obviously something about these files that Acrobat doesn't like, or else some configuration setting in Acrobat that needs to be adjusted, but I can't figure out what it is.
    Thanks in advance!

    JPegs are often problems. You might try saving to TIFF instead, the standard for scanners.

  • Convert RAW to jpeg

    Hello,
    I'm using Aperture to organize my photos and have been shooting in RAW. I'd say that out of 100 pics, I might take advantage of the RAW format to edit 5 of them. I'm new to photography and during the learning process have taken a lot of pics of, for example, my dog that I really don't need in RAW format but don't want to delete altogether. I intend to continue shooting in RAW, but would like to convert my older pics to JPEG as I've filled up my external hard drive that my library is kept on (I'm using a 2006 core duo macbook). I know the usual advice is "never convert raw to jpeg to save space, just buy a new hard drive," but I really don't need 500+ pics of my dog in RAW format, jpeg will be 100% fine, and don't want to shell out the money for a new hard drive right now (although eventually I will.)
    My question is: is there a way to selectively convert my photos or even entire projects from RAW to jpeg and maintain the organization structure? I know I can export to JPEG, but then I have to re-import and re-organize them all, correct? Either way, I then have to go through and delete the RAW versions, right?
    Thanks,
    John

    I have a desktop PC with 4 internal drives that I'm backing up my images to over my wireless network on a (somewhat) regular basis, so if/when the external does crash, i've got the images backed up. The problem is that I've only got a 60Gb in the laptop, and a 320Gb external that is partitioned to allot 90Gb for time machine and the rest shared between music and photos, which has filled up pretty quickly. I'm looking into a 1TB external for the future, but I really like my 320 western digital as it is USB powered and really great for on-the-go. Maybe I'll think about a smaller library on the 320 and the permanent library on the 1TB. In the meantime, I need to free up some space on the external one way or another.
    Thanks,
    John

Maybe you are looking for

  • My ipod isn't being recognized in itunes and not in my computer

    when i plug my 2nd generation ipod up it won't go to itunes and it wont even register in the computer. But when i plug up the 30 gig ipod it goes directly to itunes and it shows up in the address bar. I ran the diagnostic and it showed that the 2nd g

  • Link to Database

    Ok new problem. Once I have created an applet I want to display information from this applet in a drop down menu. The database I'm using is mysql and the code for the drop down menu is as follows: package orderproc; import java.awt.*; import java.awt

  • How can I create an sql query updateable report

    Seems as though after upgrading our APEX version I no longer have the option to create an updateable report. Some of my old updateable reports seem to be working fine but some will not update after I click my submit button. AT first they just refresh

  • What is a user friendly and free screencast for MBP?

    Just need a few suggestion and some advices on using it within chrome? 

  • Job Manger configuration when SQL Server Data base is used

    Hi All, I have worked on starting scheduler services after job manager configuration  and created ibots. But now we are using SQL Server. In this case we are facing a problem while configuring job manager. In SQL Server we will be having 2 types of a