BufferedImage displays as streaky; smooth image not produced

Hi all,
I have three classes that I'm working with. One is ImageProcessor, a Class I have to process images. Another is IMAQGUI, a GUI for my IMAQ service, and the third is IMAQIceStormService.
In IMAQIceStormService, I am using ImageProcessor to create an image from a byte[] that gets sent to me, and I'm using IMAQGUI to display the image on my GUI.
All this is working fine, except the image does not display properly. I am getting the proper data, as I have compared the camera image to my streaky image, and saw that they are the same. The width, height, depth, and stride should all be correct; 1000x1000 pixels, 8 bits per pixel, and a stride of 0. I recently changed my ImageProcessor code to make some methods static, and I may have broken something.
Basically, can anyone take a look at my ImageProcessor methods, and possibly give any suggestions as to why the image is not displaying correctly?
Here is the relevant part of IMAQIceStormService:
     public void imageAcquired(long id, IMAQTypes.ImageDesc imageDesc, byte[] imageData,
          Ice.Current current) {
          IMAQGUI.appendImage(ImageProcessor.createImage(imageData, imageDesc.width, imageDesc.height));
     }IMAQTypes.ImageDesc is simply the image description. It tells me the width, height, depth, and stride of the image. As you can see, I am telling IMAQGUI to appendImage based on what returns from ImageProcessor. First, here is the relevant code from IMAQGUI:
     private static JLabel imageViewer = new JLabel(); // this gets added to the main panel in a different method
     public static void appendImage(BufferedImage image) {
          imageViewer.setIcon(new ImageIcon(image));
          imageViewer.revalidate();
     }This just sets the icon to the new image, and revalidates the JLabel so it displays the new image.
Finally, here is the most important part. This is the relevant code from ImageProcessor:
    public static BufferedImage toImage(byte[] data, int w, int h) {
        DataBuffer buffer = new DataBufferByte(data, data.length);
        WritableRaster raster = Raster.createInterleavedRaster(buffer, w, h, w,
        1, new int[] {
            0
        } , null);
        ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
        ColorModel cm = new ComponentColorModel(cs, false, true,
        Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
        return new BufferedImage(cm, raster, false, null);
    public static BufferedImage createImage(byte[] data, int width, int height) {
          BufferedImage im = toImage(data, width, height);
        //image = toImage(data, width, height);
        BufferedImage out = createRGBImage(im);
        return out;
    public static BufferedImage createRGBImage(BufferedImage in) {
        BufferedImage output = new BufferedImage(in.getWidth(), in.getHeight(), BufferedImage.TYPE_INT_RGB);
        Graphics2D g = output.createGraphics();
        g.drawRenderedImage(in, null);
        g.dispose();
        return output;
    }I am unsure of why ImageProcessor is creating a streaky image, especially because I know the image dimensions are correct. Is there something I am missing? Does anyone see any mistakes anywhere? Does anyone have any suggestions?
I know this is a lot of information, so thanks a lot for any help you can provide.

Hi again,
I'm still unsure as to what the problem is here. I thought maybe it had something to do with the GUI container, but I saved the BufferedImage to the local filesystem using ImageIO.write(), and it looks the same.
Although no one has apparently seen any obvious problems, can someone possibly let me know if the methods are correct for what I am trying to do: convert a byte[] to a BufferedImage of RGB format?

Similar Messages

  • Image not displayed while running executable jar ?????

    hello everyone...i have developed a game like mario and everything is happening well......
    i have created an executable jar file of my game so that i can distribute it to my friends.............
    now the problem is :
    my all the images that are used in my game are in "Images folder", so when i run my executable jar file outside the reach of images folder than images does not get displayed on my game.................i mean when jar file is located beside my images folder then images get displayed but if i move my jar file to some other location then images doesn't get displayed.......
    i have included images folder inside my executable jar file.....but same problem arises......
    in my game, to display images i have used this code:
    Image img=new ImageIcon("Images\\hero.gif").getImage();
    so Images folder should be located at the same directory where my game is located....................
    so can anyone tell me why this is happening ?
    i want to execute jar file even if i relocate my jar file(i've put images folder inside jar).......
    Edited by: JGarage on Nov 28, 2008 10:45 PM
    Edited by: JGarage on Nov 29, 2008 12:50 AM

    inside my jar , i have these three folders:
    engine play res manifest.txt
    engine and play are packages
    to load an image i have used these code
    Image img=new ImageIcon("res\\t.gif").getImage();
    to draw image:
    g2d.drawImage(img,x,y,this);
    i had also used what u said :
    img=ImageIO.read(Thread.currentThread().getContextClassLoader().getResourceAsStream(path));
    Note: earlier u adviced me ImageIO.read(Thread.getContextClassLoader().getResourceAsStream("res/y.gif"));
    getContextClassLoader() is not an static method so i can't acess it from static context.It gave me compilation error.so i used Thread.currentThread().getContextClassLoader().
    and i haven't used BufferedImage.I have used Just Image.

  • Rich text box used in Infopath Form not displaying option to get images from Computer

    Hello,
    We have used "Rich text box" in Infopath Form which is not displaying option to get images from Computer.
    Options available are : From Address, From SharePoint
    But if we Rich text box in list, then it works fine with "From Computer" option.
    can you please help me out to get this option.
    Thanks in advance.
    REgards,
    Jayashri

    Hi,
    From your description, there is no “From Computer” option to get images with rich text box in InfoPath form.
    Per my knowledge, by design there are “From Address” and “From SharePoint” options without “From Computer” option in rich text box in InfoPath form. As a workaround, you can develop a custom InfoPath Rich Text box to do it.
    About developing a custom InfoPath control, I suggest you create a new thread on the forum “Visual Studio Tools for Office”, more experts will assist you with InfoPath development.
    Visual Studio Tools for Office:
    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=vsto&filter=alltypes&sort=lastpostdesc
    Thanks,
    Dean Wang

  • OBIEE 10G Embedded Image not displayed on PDF

    Hi
    We have some embedded images (source on network share or on the webserver) on a dashboard. On the screen the images are displayed without problems.
    But if we want to print the dashboard (f.e. PDF) the images are not printed. In html-view the images would be displayed.
    Is there a known bug that images can't be printed on dashboard pages or do we have to embed them different?
    Thank you

    Hi Team,
    I do face the same issue of image not displayed in only pdf output format. Our client has deployed OBIEE 10.1.3.4.1 using Weblogic application server and is accesible through a secured url access.
    I have followed the fmap syntax to locate the image, also made sure the image is getting accessed through url, tried with different images of different sizes . In all cases the image display is appearing fine in HTML & Excel output. But not getting displayed only for pdf output.
    Can you please help me with this regard if am missing any specific setup for pdf output. Is there is any pointers or documentation available to get around this issue.
    Thanks in advance.

  • OBIEE 11G Embedded Image not displayed on PDF

    Hi
    I have some embedded images on a dashboard. On the screen the images are displayed without problems.
    But if we want to print the dashboard (f.e. PDF) the images are not printed. In html-view the images would be displayed.
    All the images are referenced with the fmap path.
    Any way to print the images in the pdf ?
    Thank you
    obiee 11.1.1.5
    O.S : Oracle Linux 5.6 x64

    Hi Team,
    I do face the same issue of image not displayed in only pdf output format. Our client has deployed OBIEE 10.1.3.4.1 using Weblogic application server and is accesible through a secured url access.
    I have followed the fmap syntax to locate the image, also made sure the image is getting accessed through url, tried with different images of different sizes . In all cases the image display is appearing fine in HTML & Excel output. But not getting displayed only for pdf output.
    Can you please help me with this regard if am missing any specific setup for pdf output. Is there is any pointers or documentation available to get around this issue.
    Thanks in advance.

  • LinkToAction Image not displaying in NWDS

    Hi,
    I am on NWDS version Version: 2.0.14.
    My imageSource file (abc.gif) associated with each LinkToAction type element displays fine in execution mode.  However, the image does not display in NWDS.  All I see is a blank in the layout where the link is.  I also have a blank text property because I only wish to show an image for the link. Images not showing in NWDS slows considerably my layout development. 
    Conversely, when I create an Image type element and I specify the imageSource file the same way, I see the image in both NWDS and in execution mode.
    My image files are stored appropriately in the mimes\Components folder.
    What could I be doing wrong?  Is this a bug with NWDS?
    Thanks,
    Kevin

    Probably a bug. Real WYSIWYG will be available in the new view designer implementation.
    Armin

  • Image not displaying in HTML output

    Hello! We have been using Report Builder 10.1.2.0.2 to generate PDF reports which contain a logo. However, when the same report is changed to DESFORMAT=HTML or HTMLCSS, we get a red "x" for the image. I'm not sure if this is issue can be resolved within the Oracle RDF file itself, or whether it is because of our architecture. We are executing the reports from Oracle Application Express, which utilizes HTTPS protocol and is hosted by Oracle HTTP Server on a server located in the DMZ of our corporate network. The Reports Services server is on a separate server, located within our corporate network. The Oracle Reports are executed through the browser using HTTP protocol. Could this be an SSL issue or a reverse-proxy issue on OHS? It seems that the image cannot be displayed in the browser because the path to the image is not recognized or valid. The image was embedded in the RDF file via Insert...Image, not File Link. This issue is not exhibited in our DEV environment, where both OHS and Reports Server are within the network. Any ideas would be appreciated.

    Hello,
    Right click on the red "x" and select "properties" to check the URL used to "download" the image.
    The reports servlet will use information defined in the HTTP server conf file (httpd.conf) to build this URL
    Parameters are :
    ServerName
    Port
    UseCanonicalName
    You can fnd details in the "My Oracle Support" document :
    How the Reports Servlet Builds the URLs Inserted in the HTML/HTMLCSS output (Doc ID 276306.1)
    Regards

  • JPG images not displayed correctly in Bridge and Photoshop (Mac OS)

    (Note: I have copied the content of this query from the Creative Suites forum where I originally opened it.)
    I am using CS4 under OSX 10.4.11 on a PowerMac G5 Quad with 23" Apple cinema display. Images which have been captured as JPG are displayed fine by Preview, but when opened in Bridge, Camera Raw or Photoshop. the colours are all "washed out". The attached screen capture should give an idea of the difference, with the upper being Camera Raw (image settings) and the lower being Preview. My monitor has been calibrated and I'm using sRGB IEC61966-2.1 colour space in Camera Raw and Photoshop. The colours displayed by Preview are pretty close to "real life". I find it virtually impossible to adjust the colours in Photoshop to get back to anything similar.
    After opening the image in Photoshop without adjustment, and Save As JPEG with embedded color profile, Preview displays the new image the same as Photoshop. Save As JPEG without embedded color profile, and Preview displays this copy just like the original. It seems that Photoshop is making different (incorrect) assumptions about what color space to use when there is no embedded color profile. Shouldn't it assume sRGB like virtually everything else (http://en.wikipedia.org/wiki/SRGB)? Or is its interpretation of sRGB incorrect? How can I fix this?
    Re: JPG images not displayed correctly in Bridge and Photoshop 

    xxxxyyyyz wrote:
    …If there is someone out there who has experience of obtaining decent colour management in CS4 on a Power PC, I would really like to know how you achieved it.
    That would be yours truly, and I hasten to reply because I may have some insights that can help you too.
    Just get it it out of the way, here's my setup:
    Photoshop 11.0.2 ("CS4"); VersionCue disabled and uninstalled.—2.5 GHz Power Mac (PPC) G5-Quad; 16GB RAM; mutant, flashed 550MHz nVidia GeForce 7800GTX 1,700MHz 512MB VRAM; ATTO ExpressPCI UL5D LP SCSI card; Mac OS X Tiger 10.4.11 and Leopard 10.5.8 boot drives; Spotblight, Dashboard and Time Machine permanently disabled; dual 22" CRT monitors; USB wireless 'n' available but connected to the Internet via wired Ethernet; 1 FW flatbed scanner; 2 SCSI scanners (one tabloid-size transparency scanner and a film scanner); various internal & external HDs; FW Epson 2200 and Ethernet Samsung ML-2850ND printers; 2 X Back-UPS RS 1500 XS units.
    I can unambiguously and in good faith represent to you that my color management, from capture to print, is as spot-on as anyone with any kind of setup can hope to achieve.  Unequivocally and without qualifications.
    Now, first things first:  Forget about trying to synchronize color management across the point applications lumped together only by Adobe marketing fiat into a variety of meaningless "creative suites".  Concentrate on Photoshop.  Do not try to use Bridge to synchronize anything.
    The "suites" are a totally artificial construct created by Adobe bean counters and marketing types.  The point applications (i.e. the individual programs clumsily bundled together, e.g. Photoshop, Illustrator, InDesign, etc.) are developed independently by separate engineering teams that are not only not in the same building, but in different cities, different states of the American Union, and even in different countries.  They have very little communication among them, if any, as evidenced by repeated posts in these forums by Photoshop engineering staff urging us, the end users, to let the other teams know in their own forums that a given problem exists and is actually affecting our work.
    Enough said about the cause of the problem.  The end result is that Color Management is at very, very different levels of progress and sophistication in each individual point application, with only Photoshop fully entitled to be considered state of the art.
    Secondly, a disclaimer:  I have been hanging on to my CRT monitors and take care of them as Jascha Heifetz used to take care of his Stradivarius.  I don't know what I will do if I manage to outlive the usefulness and accuracy of my CRTs (unlikely at this point).  I have despaired in futile efforts to bring the luminosity of any LCD monitor down to where I would feel comfortable calibrating and profiling it.  I believe my monitors are the foundation of my color management efforts.
    Especially if you have one of the extreme wide-gamut LCD or LED monitors, you'll face an uphill battle. 
    Be careful to avoid any version 4 icc profiles, whether canned or generated by your calibration software.  Stick to version2 icc profiles.  Ask the manufacturer of your calibration software/hardware if in doubt.
    Here are some not-too-recent, but thoroughly representative screen shots of the calibration results I obtain with my monitors, which I calibrate and profile often and regularly (I validate the calibration at least several times per month).
    In a nutshell, my color management practices and settings mirror those described by Bruce Fraser, Jeff Schewe, Andrew Rodney and Gary Ballard's site.  I have learned from all of them.
    My working color space is ProPhoto RGB.  I choose to work with PSD and PSB files.  As a long-time, rabid JPEG hater, I only rarely deal with JPEGs, using them sporadically to illustrate a point in this forum or elsewhere in the web.  My main output consists of prints.
    I only deal with tagged image files (files with an embedded color profile) and often recommend beating up with a baseball bat any moron that hands you an untagged file—figuratively of course, but I find the expression gets my point across unambiguously.
    Following is a screen shot of some of my pertinent settings:
    Note that I have never bought into the "suite" concept myself.  I do have and routinely use Adobe Illustrator 10.x, InDesign 2.x and Acrobat Professional 8.x, but they are all older, independent versions of each point application, licensed at different times.
    Be further advised, that the answer to many problems offered by Adobe engineers often is not to install VersionCue, or uninstall it, or at least disable it.
    Also, as outlined at the beginning of this post, concentrate on Photoshop, not on synchronizing applications that can't really communicate with each other, despite the claims of Adobe marketing hacks to the contrary.
    One big caveat, do not fall into this trap:
    xxxxyyyyz wrote:
    …I believe my problem has nothing to do with my monitor profile, for several reasons, but…
    …It seems extremely unlikely to me that…
    You either want to learn, or you don't.  You either want to solve your problems, or you don't.
    When you start arguing instead of studying, questioning advice instead of following it and detecting where you went wrong, you're on the right track to nowhere.  That attitude will get you there fast.  Remember you are the one with the problem, and only you can acquire the discipline to learn how to solve it.
    Go ahead and ask me anything that is not clear, just don't argue with me please, and don't tell me why you think Fraser, Rodney, Ballard and I are wrong.  You see, I am not experiencing any problem that needs fixing.  I have an interest in helping you, but not in hearing about your speculations, theories or conclusions.
    Good luck.
    Wo Tai Lao Le
    我太老了

  • Images not displaying in Revel (Carousel)

    I'm using Revel to transfer pictures from my iPhone to my iPad. Several times I've selected and loaded an image to Revel--it displays on my iPhone (although not always) but does not display on my iPad. If I try to reload, it gives me the message that 1 duplicate photo was skipped. I've tried closing the app, and turning my device on/off but it doesn't seem to make a difference.
    Suggestions?
    thanks,
    Michael

    Hi Michael,
    Images on your iPhone have to successfully upload to the Revel cloud service before they can be viewable on the iPad, that might be the issue. To check, hit the View Status button down in the lower right hand corner on the iPhone in the thumbnail view in Revel. That will show any images queued up to be uploaded. You might try connecting your devices to a home WiFi network if they aren't already, uploading a lot of images can be kind of bandwidth intensive to get everything uploaded. If the image was already queued up to be uploaded that would make sense why you were getting the message about it being a duplicate photo.
    -Dave

  • CF slows down to a halt ... images not displaying

    My primary laptop on which I do all coding ...
    - less than 1 year old
    - Dell (cough) XPS M1730
    - Windows XP (latest)
    - ColdFusion Ver 8, developer edition.
    - No other issues with laptop
    Also running
    - SQL 2000
    - Synergy
    - Anti virus etc. changed Norton daily scan and unaware that I have picked up any viruses - I was my hands very well and often
    Over 6 months gradually CF has been slowly not display internal referenced <img src> tags.  External work fine.
    To the point now where most in our app do not display.
    Then in the past 3-4 days a lot of pages when called give Firefox or IE errors:
    Page will not display with too may users error.
    But there aren't any others.
    I go to all other web site, no issues with speed.
    I just cold warm booted the machine and now while page 1 appears, page 2, login, takes minutes to appear.  But on a beta server (also developer edition) it's instant.
    When I go straight into the browser, it works fine, albeit no images, crashes with a known bug (missing application variable), fix it, then resume, then just sits there forever.
    And there's no difference between the two machines ... well, not in "that" way.
    Adding to my confusion is ... I cannot get into the CF Admin panel.
    I can see it approve me, then it just spins.
    Nothing has changed on machine in past weeks EXCEPT traveling when I sign in to the usual plethora of wifi and other networks but never had a problem - except luggability
    I am thinking of, UGH, reinstalling Windows ... but why bother if it's working perfectly and only ColdFusion has an issue.
    Now COLD booted machine for 5 minutes.
    Everything seems better except CF still a BIT sluggish and still not "drawing" most images.  Able to access Admin panel.  Even if there images not displaying.
    Anyone any ideas?

    Thanks for your prompt reply ...
    We scoured for a folder like that and found none.
    What we DID find is that over the years of coding, we have a template count of 3,500 files in 130 folders, but the root where we start is about 1,500 files.   144 megs total size though.
    That shouldn't be too much?  Esp as our beta and production servers are using the same amount with no issues.
    Admittedly production is CF 7.X.
    Much more powerful machines but still.
    It would have made sense as that is the only thing on the machine that has "grown" ... but no luck.
    Does remind me of the day when our mail server got hacked and we had 100,000 outbound in the spool.  That was fun.: :)

  • JToolbar images not displaying

    I have JDK 1.3 /Windows 2000 Pro and My toolbar icons sometimes display and sometimes don't. I have about 12 tool icons, most of which show up, but usually a couple don't display. All icon images do display in the buttons at one time or another, so it is not an icon image problem (a straightforward one at least).
    The images do load correctly and the code is done in the main thread (without any background threads created by me). The code is completely serial, using the standard calls (ImageIcon() to load the images).
    Has anyone seen a problem loading up their toolbars?
    If I use 3-4 toolbars they always load so something seems to be going on in the background which I can't seem to control.
    Any feedback appreciated. I can provide code it you have seen anything like this.
    Thanks

    I'm having a similar problem. Have you figured out a solution yet?

  • RE: Images not displaying...

    I am a very novice user of RoboHelp and inherited maintenance of the files from a source who left the company.  We use Team Foundation Server to store source files and Harvest to publish the files; however, in the last week I noticed new images added were not displaying ..somehow the images folder now displays under the Webhelp folder instead of at the same level of the folder and now none of my graphics display. In RoboHelp all the images are housed in a separate folder under Project Files and now display with a red X...when I check Properties it says the image is "missing"---any suggestions form the experts on how to resolve?  

    @bmooney
    I suggest you create a new user name. On any forum, not just these, you should never expose your email address in this way. It is wide open to spammers.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • I recently connected my new MBA to an ACER display using the appropriate Apple hardware to connect to a VGA port. The quality of the ACER display is poor- the image is not clear. How do I achieve the same clarity of picture as my MBA screen?

    I recently connected my new MBA to an ACER display using the appropriate Apple hardware to connect to a VGA port. The quality of the ACER display is poor- the image is not clear. How do I achieve the same clarity of picture as my MBA screen?

    Welcome to the Apple Community.
    AirPlay Mirroring requires a second-generation Apple TV or later, OS X 10.8 or better and is supported on the following Mac models: iMac (Mid 2011 or newer), Mac mini (Mid 2011 or newer), MacBook Air (Mid 2011 or newer), and MacBook Pro (Early 2011 or newer).
    On the basis of the specifications you have given for your set up, mirroring should work.

  • I need to connect my Imac 27'' (newest version) up to 3/4 monitors (all 40'' LCD tv's with VGA and HDMI connections) with extended display to all external screens, not duplicate images. Is this possible?

    i need to connect my Imac 27'' (newest version) up to 3/4 monitors (all 40'' LCD tv's with VGA and HDMI connections) with extended display to all external screens, not duplicate images. Is this possible?

    I would suggest you visit an Apple dealer, preferably an Apple Store if there's one in your city, and ask for assistance in determining what you need. The questions and issues you bring up are rather complex to address in a technical support forum and would be better addressed in person where you and the salesperson can ask questions back and forth to arrive at the optimal setup.
    Regards.

  • Image not displaying in the Task Sequence Wizard. SCCM2012

    This is my question, so I will post the link here.
    http://community.spiceworks.com/topic/925727-image-not-displaying-in-the-task-sequence-wizard-sccm2012
    Bryan
    I captured an image from a PC that I am preparing to be deployed with Office 365. Once I captured
    the image, I went to the software library to add the operating system image. That seemed to go on without any issue, but when I look at the summary, I see the big yellow globe saying "in progress" it has not changed since yesterday afternoon.
    I then created the task sequence for this image
    to be deployed under Software Library, Task Sequences. When I selected the references tab, everything seemed to be in order with the exception of the "operating system image" under type. It was/is showing 0.0% Compliance.

    So, the problem described in the other forum post does not match the title of this thread. Are you trying to address two different things? These are unrelated btw.
    For the issue in the other thread, you'll have to troubleshoot your content distribution to the selected DP. The distmgr.log and pkgxfermgr.log (assuming you chose to distribute the image to a DP directly attached to your primary site) are the places to
    start and will show you exactly what's going on.
    As for the title of this thread, we'll need a lot more info to help you there.
    Finally, I would suggest you copy your questions from other sources into the thread -- this will help other folks in the future that may stumble upon this thread and will prevent any confusion.
    Jason | http://blog.configmgrftw.com | @jasonsandys

Maybe you are looking for

  • Help with using Scanner Class

    Hi there - I'm a newbie to Java and may have posted this in the wrong forum previously. I am trying to modify a program so instead of using a BufferReader, a scanner class will be used. It is basically a program to read in a name and then display the

  • Multiple problems with PSE10 Organizer

    I have Photoshop Elements 10 that I am using with Windows XP with Service Pack 3, a Pentium 4 CPU with 3 GHz, 2 GB of RAM and 48.6 GB of free disk space. I have had multiple problems with Organizer since I started using it. When I first got PSE10, I

  • Quote and Sales Order BOM Explosion

    We are attempting to utilize a ETO process without PS.  We create a sales quotation and begin to build a quote BOM (using type 1 production) and a Routing for the entered quotation.  Eventually we decide to create a sales order with reference to the

  • Why all these problems?

    im totally on hold after reading all these problems with the MBP SR. I thought long and hard and though my money is already paid in full Im not going for it yet! Might wait till Leopard is in it. Anyone having NO PROBLEMS!?

  • N82 Animated SMS and Predictive Text Problems

    I've just got a new N82 and think it's a great phone. I downloaded and installed the Animated SMS program from Nokia's software site and have a couple of problems! The first is that I've set my left direction shortcut to come up with a New Message, n