Best method of reading RGB image data?

Hi all
I scanned the forums for this and am sure you have all been asked it a million times, but I'm a little unclear
What is the best image format to use to read RGB values from image data & eventually save these values for manipulation, hopefully not going into JAI (as never used) if can be helped. I had been advised to use .BMP by my lecturers but as this is not directly supported by Java was wondering what the next best format would be.
At a guess it looks to be .gif but if this is not the case would appreciate any advise

I'd go png: jpeg is losey by default and gif uses a palette:
BufferedImage image = ...
boolean success = ImageIO.write(image, "png", file);
//elsewhere
BufferedImage image = ImageIO.read(file);

Similar Messages

  • Help! Read raw Image data from a file and display on the JPanel or JFrame.

    PLEASE HELP, I want to Read Binary(Raw Image)data (16 bit integer) from a file and display on the JPanel or JFrame.

    Hey,
    I need to do the same thing. Did you find a way to do that?
    Could you sent me the code?
    It's urgent, please.
    My e-mail is [email protected]

  • How to read the Image Data using HTTp Request response

    i want to read image data from server please send me any code or answers.
    and also i want to exit application using button control for iphone simulator.
    thanks in advance.

    You would do a URLRequest and download the image. You could save it to disk and then load it or directly create a new image with the binary data.

  • What is the best method for storing/retrieving images?

    Friends,
    OS: RHEL AS 3
    DB: 9iR2
    We have some critical situation. We need to scan all our Purchase orders and to store in our pc. we don't want to store the images in the database. it will be a big headache. We have 4 branches in different cities. All the branches are connected to our local network. We have novell server in every branches to store the oracle forms and the db is centralized in our head office. The purpose is to view any PO in any branch.
    so,what will be the best solution for storing the images for our archiving?
    thanks & regards

    Yes - a good quality external hard drive is the answer
    Moving the iPhoto library is safe and simple - quit iPhoto and drag the iPhoto library intact as a single entity to the external drive - depress the option key and launch iPhoto using the "select library" option to point to the new location on the external drive - fully test it and then trash the old library on the internal drive (test one more time prior to emptying the trash)
    And be sure that the External drive is formatted Mac OS extended (journaled) (iPhoto does not work with drives with other formats) and that it is always available prior to launching iPhoto
    And backup soon and often - having your iPhoto library on an external drive is not a backup and if you are using Time Machine you need to check and be sure that TM is backing up your external drive
    LN

  • Best method for collecting low frequency data

    Hello everyone,
    I'm looking for suggestions on the best way to collect relatively low frequency data (about 1 Hz). I know there are a few different ways to do so in labview such as the DAQ assistant or making DAQ mx and making your own virtual channel. Also there are an abundence of different settings to choose from. I'm using an NI 9215 DAQ card and am collecting voltages. I would be interested to here any opinions on a method for doing so and maybe the settings that they would use.
    The reason I'm asking is because I'm just using the DAQ assistant but I'm really not sure if that's what I want to be using. I feel like there is a better way.
    Thank you all!

    winterfresh11 wrote:
    Is this different from triggering? Because this particular DAQ card can't be triggered.
    There is a big difference between triggering and sample clock.  The trigger tells the DAQ to start acquiring data.  The sample clock tells the DAQ when to take a sample.  You trigger once per acquisition.  The sample clock just keeps on going until the acquisition is complete (either aborted or desired number of samples is acquired).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Best Method for Importing and Exporting Data to a local 'resrouce'  file

    I've searched the forum, and seen glimmers of hope to what I am trying to piece together - but not in a concise way that will sink into my brain.
    Using Javascript on a PC for IDCS2, I'm writing a simple script that has a user interface.
    I'd like to have 4 default values for the user interface to be read from (and if altered, written to) a text file.
    What's the simplest way to go about this? I've read through many posts, and toyed around with readln and writeln functions, but nothing is working out. For some reason, I can't send any information to any file - let alone read it back in.
    Could somebody point me in the right direction? For simplicity sake let's say I have just one variable, "myVariable" - and I want to send it to and read it from c:\test.txt.
    Someday - this will all sink in. Right now, I'm reaching for Aspirin.

    Hi D Scott Chinn,
    Try something like this:
    var myFile = File.saveDialog ("Save file as:")
    if(myFile != undefined){
    var myString = "Write this string to a file."
    myFile.open("w");
    myFile.write(myString);
    myFile.close();
    Thanks,
    Ole

  • I just bought a macbook pro. I currently have a G4. What is the best method to move all my data to my new computer?

    My main concern are songs that I imported from cd's.

    Don't use migration/setup assistant.  Going from a PowerPC G4 to an Intel-based system is best handled outside of migration assistant.  It's not difficult (I've done several of these conversions).
    See this Apple user guide: https://discussions.apple.com/docs/DOC-2295
    In addition, see this thread, about half way down, pick up Cornelius's post: https://discussions.apple.com/thread/2195685?threadID=2195685&tstart=0

  • What's the best way to read JSON data?

    Hi all;
    What is the best way to read in JSON data? And is the best way to use it once read in to turn it into XML and apply XPath?
    thanks - dave

    jtahlborn wrote:
    without having a better understanding of what your definition of "use it" is, this question is essentially unanswerable. Jackson is a fairly popular library for translating json to/from java objects. the json website provides a very basic library for parsing to/from xml. which one is the "best" depends on what you want to do with it.Good point. We have a reporting product ([www.windward.net|http://www.windward.net]) and we've had a number of people ask us for JSON support. But how complex the data is and what they want to pull is all over the place. The one thing that's commin is they generally want to pull down the JSON data, and then put specific items from that in the report.
    XML/XPath struck me as a good way to do this for a couple of reasons. First it seems to map well to the JSON data layout. Second it provides a known query language. Third, we have a really good XPath wizard and we could then use it for JSON also.
    ??? - thanks - dave

  • Best method of importing from external drive?

    I have a 1T LaCie and want to know the best method to get those images into LR. The defaults are: "Add" and "NewPhotos" to "MyCatalog"
    I think I may have more than one catalog and am not certain how to combine them. Is it best practice to have only one catalog?
    Thanks in advance,
    Mr Mayor

    Duplicate thread, see Best method to import from external drive?

  • Read Excel cell data automatically

    From the given examples, before reading an excel data, you have to specify the start cell and the end cell number. Is there a method to read out excel data just by giving the file name?
    David

    Well, then you can open Excel, open the first sheet in the collection and then iterate into the sheet and search for non-empty cells.
    You can use the source code for ExcelRpt_ReadDataToTableControl () function into excelreport.c code as a guideline to develop your own function: iterate on all cells in the sheet and try to load only those that do not return CAVT_EMPTY in CA_VariantGetType () function.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Read large images fast?

    Hello all,
    I'm not sure if this is the appropriate place to post this but here goes. I am working on creating an image viewer application and so far its going great. But i've noticed one problem when reading large images typically over 1 megabyte in size. These images using <tt> ImageIO.read() </tt> takes anywhere from 1 to two seconds to finish loading. I've searched all over the web for faster methods of reading large images but I haven't had any luck. Here is an example of what code i'm using to read an image.
    try {
         BufferedImage b = ImageIO.read(someLargeImageFile); // this is slow for images over 1MB in size.
    } catch(Exception err) {
    }So my question is does anyone have any tips or tricks I could use to read large images faster. I see programs like iPhoto reading images up to 5MB in size in under one second. Just wondering what I could do to read these kind of images just as fast.
    Thank you for your help :)
    Nathan D.

    user5287726 wrote:
    What version of the JVM are you using? How much RAM is available? What OS are you running? What kind of storage are the images on? How many other users and how many other processes are fighting over that storage?
    And if the JVM is recent and has a lot of RAM available, and you have eliminated any storage bottlenecks, have you tried Java Advanced Imaging?
    http://java.sun.com/javase/technologies/desktop/media/jai/
    I've used it to process image files in the hundreds of MB size range, and while I don't have any benchmarks handy I'd be surprised if those files were processed much if any slower than the processing speed you're getting with your much smaller files.I'm using the most current JVM, lots of RAM is available the application i'm developing can use up to 1.5 GB of RAM on the current machine. I'm using Mac OS 10.6 but the problem occurs on all operating systems i've tested it on including, Windows XP, Windows Vista, Windows 7, Mac OS 10.4, 10.5, 10.6, and Linux. I develop the software on an iMac which I just recently reformatted to factory settings so there are little to no other processes fighting over that storage.
    I've heard of JAI and just really never gave it a second thought cause I never really needed any more features then ImageIO gave me. However does Java Advanced Imaging read images in a different way then ImageIO would? I'm beginning to think that it isn't so much the actual size of the file but the dimensions. Even small files in the 100kilobyte range load slow because there dimensions are large for example 3000x3000. Though i'm assuming those 100 megabyte images you processed with speed also had large dimensions?
    Now for a moment I was thinking it was something in the BufferedImage class that was taking a long time to process and not the ImageIO class. However the following proves that wrong.
    try {
         ImageIO.read(someLargeImageFile);
    } catch(Exception err) {
    }The above code doesn't even use a buffered image so I guess its down to something in the ImageIO class. I'll see if I have better luck with JAI but can someone explain why this might be faster then using ImageIO.read() or if there are any other tips or ticks to reading large images such as these faster?
    Thank you for your help :)
    Edited by: neptune692 on Jan 6, 2011 8:35 AM

  • How to read an image in portal component (EAR application) - in CE 7.1

    Hi All,
    In earlier versions of portal before CE 7.1, we were using the below code for reading an image from the component folder.
    But in this CE 7.1 portal component ( we deploy as ear application) the reading an image from folder for the method was showing as deprecared. please let me know the right code to read an image from folder in portal component.
    componentRequest.getWebResourcePath()+  - > which is deprecated in CE 7.1, but was working fine in earlier versions of CE 7.1.
    Please let me know the right method to read an image in CE 7.1 portal component (ear application)
    Thanks,
    Portaluser100

    Hi,
    You still can use the same method (It works in Portal 7.3 system)
    <%
    String  path = componentRequest.getWebResourcePath();
    %>
    Alternatively , a new method, you can refer to your images directly with your project name
    For example, if your project name is "com.yourcompany.customapp" then you can use the following statement:
    img src="/com.yourcompany.customapp/images/....."
    Abdul.

  • What is the best method to revert back to 'golden' image of database

    Hello,
    I want to have a 'golden' image of my test database. What is the best method to keep reverting back to this 'golden' image after testers are done with testing. What I mean is I want to set up a test database for testers. Testers can insert,update, delete on objects as they like. But after the testers have completed their testing, I want to revert the database back to the 'golden' image. This 'golden' image is the state of the database before testers perform their tests. I need to revert back to the 'golden' image many times over as we have to perform many different tests.
    I thought about export and import (9i database) but takes 6 hours, too long. I tried using rman and was successful the first time, (set until time; restore database; recover database; open resetlogs;). The seconde time using rman, I got error saying the set until time was before the resetlogs time. I think I would have to restore the control file before the resetlog time frame before I can recover to the set until time, again.
    What is a straight forward method to have a 'golden' image so I can keep on restoring back to it? This database is a test 9i database and it is in archive log mode but it doesn't need to be. I just need a best practice method, whether it is rman, exp/imp, manual backup/restore? Something I can use time and time over again. Thank you.

    If it is a Test envionment, can you just take a COLD Backup (database files
    plus control files) ? How big is the database ? What platform is it on ?
    eg in a COLD Backup
    a. If using a script, run multiple "cp" (or cpio/tar) commands in parallel to
    copy different database files
    b. If using RMAN (in NOMOUNT), use multiple Chnanels.
    Note : Remember to include ControlFile Backups and Restores as well.

  • Best method for refreshing a component's data?

    What's better when you want to refresh the content of an object? Should you just replace your JComponent with an entirely new one, or should you try to get access to the data and then remove the items and then re-add them.
    In my example, I have a JTree and am not sure which would be the best method to use. Should I try to remove all the nodes, or sometimes I think it would be easier to just remove the tree component from my panel, create a new tree and re-populate it?
    Thanks for any advice.

    pjbarbour wrote:
    I'm not quite sure what would be the best method for this.  My client is using a 4x3 screen and SD projector at a large meeting, and they want me to just create a DVD that is letterboxed.  I have one Premiere CS5 project that's 1920x1080, and another project that's 720x480 widescreen (1.2).  I created a new sequence in both projects that is 720x480, 4x3 (0.9), and what I do is just scale the timeline down so that it's letterboxed.  Is this the best method for achieving this?  Or would you do something else?  I don't like the idea of scaling my timeline down in Premiere.
    Hello.
    As Jim so rightly points out above, you do not need to do anything.
    Just use your normal 16:9 widescreen footage, and author as normal.
    Your player will letterbox automatically when it is connected to a 4:3 screen in setup (just make sure "Pan & Scan" is not also there)

  • Best method for plotting data array?

    I am reading data from a Delta Motion controller and writing that data to an array in my vb.NET program.  The data is not time stamped but I know what the sampling interval is (0.001s).  I want to take that data and plot it on my Waveform Graph.  What is the best method for doing this?  I'm sure this is simple, but I'm new to MS and LV.
    Private Sub btnRampUpA_Click(sender As Object, e As EventArgs) Handles btnRampUpA.Click
    Dim Axis0ActualPrsData() As Single = New Single(4096) {} 'Create array for data from the RMC controller to be read into
    Dim Axis0Actual() As AnalogWaveform(Of Single)
    If RMC.IsConnected(PingType.Ping) = True Then 'Check to make sure comms to RMC is good before trying to read data from it
    Try
    RMC.ReadFFile(FileNumber150.fn150Plot0StaticUA0, 112, Axis0ActualPrsData, 0, 4095) 'read the plot data where sample period = 0.001
    Catch ex As ReadWriteFailedException
    MessageBox.Show("Unable to read plot data from the RMC. " & ex.Message)
    End Try
    End If
    End Sub
    Thank you

    PlotYAppend appears to be the answer according to the white page, although I don't have it working as of yet.  Can someone confirm?

Maybe you are looking for

  • Certificat question

    Hello Friends. PERFORM subroutine USING var. The var field is known as what type of parameter? A: Formal B: Actual C: Static D: Value thanks in advance, Moderator message - Please see Please read "The Forum Rules of Engagement" before posting!  HOT N

  • Combobox getSelectedItem method

    Hi I have a problem in retrieving combobox values. I have a frame window with 3 textfield, 1 Combobox and 3 buttons. When I click "Ok" the frame must be closed, and i want to save the values stored in textfields and combobox at that moment. I have a

  • Itunes 11.1.5 crash, wiped out library and now not opening files

    Itunes 11.1.5 crashed on my Mac OSX 7.5, wiping out my Itunes library and playlists. I have the albums on my hard drive but can't even open them with Itunes now (I can open them with other programs). I've tried redownloading Itunes thinking that some

  • Songs deleted off my Ipod

    I downloaded a new version of iTunes, and some of the music that I had on my iPod came from another computer. When I connected my iPod, I forgot to change the settings to manual, and a ton of songs were deleted off of my iPod. Does anyone know if the

  • How can I turn on the auto Capitalization?

    Wondering if there is any way to turn on auto capitalization on laptop that will work on anything that i type, it being on Pages or on any other program.