Displaying a raw image

Hi.
Suppose I have an int array (it's really a byte array) that consists
of pixel values (8 bit). All I want to do is display the image.
I'm new to this in Java and have found many different possibilities
but I don't have time to explore them all.
I'd like to create a BufferedImage out of this array since this would
most easily work into my application (even a RenderedImage would be ok).
I have a GUI frame extended from JFrame.
How do I do it?
Any help is greatly appreciated.
-Anthony

your pixel values are 8Bit ?
when u get the RGB values i can help you out with some generic code
// now create image from pixels
BufferedImage aImage = gc.createCompatibleImage(width, height, Transparency.BITMASK);
// look in Transparency for other constants BITMASK will create transparent bitmap, means only pixels set by u will show others are transparent use OPAQUE therwise, TRANSPARENT is not good, because
java will not ( not NOW) accelerate it when drawing it on the screen
// copy data to buffered image
int index = 0;
for ( int y=0; y<height; y++ )
for ( int x=0; x<width; x++ )
aImage.setRGB(x, y, pixelData[index++]);
voila now use
g.drawImage(aImage,x,y,null) in the paint() method to display the Image

Similar Messages

  • Display of .CRW (Raw) images in Bridge CS6

    I have recently upgraded from PS CS3 direct to PS CS6. I have an issue with the display of raw images taken by my Canon PowerShot S70 camera (.CRW format). Many of the portrait-style images are displayed as landscape. This appears to be random as not all portrait images are affected. I did not have this problem with CS3. I have discussed the matter with the Adobe helpdesk which suggested various remedies (purging cache, resetting preferences) to no avail. They came to the conclusion that PS CS6 does not fully support the file structure generated by this camera in that it cannot detect from the file data that it should be displayed as a portrait image rather than as a landscape image. I have two issues with this. Firstly, if true, it means that PS CS6 has taken a slightly backward step as far as I'm concerned and secondly, it does not answer the random nature of the incorrect display.
    Obviously I want these images to be displayed correctly. I can rotate them in Bridge/PS manually, but I have a lot of them scattered over many folders and it is a task I would rather be automated.
    This issue also occurs in Windows 7 Home Premium, but as I was using Win 7 HP with CS3 without this display issue, it appears to be an Adobe problem as it only occurred after the upgrade to CS6.
    Has anyone else experienced this problem? If so how have you solved it? Is there a fix for it?
    Many thanks
    Richard
    Richard Malpas

    I have just checked my .CRW files and realise that the display problem is not random, all .CRW images shot in portrait mode are displayed as landscape. This appears to be an Adobe issue and means that the helpdesk was right - PS CS6 does not fully support this type of Raw file.

  • LONG RAW images from remote db display in APEX

    How do you display long raw images in APEX(Application Express 2.1.0.00.39) from a remote db?
    The code below works in 9i db MOD_PLSQL
    CREATE VIEW PICTURES AS(
    SELECT PICTURE_OBJECT_ID,
    PICTURE_DATE,
    PICTURE_OBJECT_TYPE
    FROM REMOTE_PICTURES@DATABASE_LINK);
    CREATE OR REPLACE PROCEDURE JPG (
    p_id IN pictures.picture_object_id%TYPE
    IS
    s_image LONG RAW;
    l_amt NUMBER DEFAULT 30;
    l_off NUMBER DEFAULT 1;
    l_raw RAW (4096);
    BEGIN
    SELECT pictue_data
    INTO s_image
    FROM pictures
    WHERE pictue_object_id = P_ID
    and pictues.pictue_object_type = 'EMPLOYEE';
    OWA_UTIL.mime_header ('image/jpg');
    BEGIN
    LOOP
    DBMS_LOB.READ (s_image, l_amt, l_off, l_raw);
    HTP.prn (UTL_RAW.cast_to_varchar2 (l_raw));
    l_off := l_off + l_amt;
    l_amt := 4096;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    In 9i this was called like. (HTML tags have been modified to display in post.)
    htp.tablerowopen;
    htp.p('<>td valign=middle align=center<>');
    htp.p('<>IMG SRC="/pls/dad/jpg?p_id='|| v_picture_object_id ||'"<>');
    htp.p('<>/td<>');
    htp.tablerowclose;
    I am trying to get the same thing to work in APEX. I have tried this in APEX(Application Express 2.1.0.00.39) sql report region and specifying the image to display in link column by doing:
    <>img title="#IMAGE#" src="/apex/#OWNER#.jpg?p_id=#IMAGE#" width="57" height="75" /<>
    Any suggestions would be helpfull. I can not migrate the long raw data type due to restrictions.

    Vikas,
    I have tried to find/produce error, but no luck. All I have is a blank image holder area the size specified in the <>img tag. How can I produce a visable error? I have tried to run the procedure from sqldeveloper with no luck. I used to have a tool (plsql developer) where I could test the pocedure and see the actual (image)output, but the version is not compatible with 10g. I will read the link.

  • Bridge won't update and doesn't display raw images from my Sony cameras.

    Using new Win8.1 laptop that recently have displayed Sony Raw images.Using PS CS6 stand alone which does nothing when asked to update. Adobe asked for ID verification which I did but didn't help.

    Camera Raw version 7.x only works with CS6.
    You need Camera Raw 7.3 (CS6) or DNG Converter 7.3 or Lightroom 4.3 to open your 6D raw files, because it did not exist before these versions. Camera Raw updates are not usually provided for old versions of Adobe software.
    Propriety raw format support can only be added after a new camera's release, unless manufacturers broadly adopt the DNG format as an alternative. Fortunately, DNG Converter is free, and you can use this to create DNG files from your Canon's raw files, to be opened in any version of CS/Lr.
    http://blogs.adobe.com/lightroomjournal/2012/12/camera-raw-7-3-and-dng-converter-7-3-now-a vailable.html

  • Can the iPad display RAW image files?

    I know you can import RAW image files from a camera to the iPad.  Will the iPad be able to display the RAW image files?

    1) No you can't sync PDFs (Yes I know, this really annoys me too) I can sync and view a 700mb movie but can't sync and view a 1mb PDF, go figure. The only way I have found to save a PDF is to make a folder in my .Mac account then place an email with a PDF attachment into this folder. Now when you open it in Mail you can only view it in Portrait View (Vertical). So trying to read a PDF is almost impossible unless you enlarge it to the point where half the page is off the screen. Yea this phone has PDF support, but the worst, most limited support imaginable.
    2) Nope, you can't save PDFs from Safari (Or save anything else for that matter.)

  • Why won't raw images display as thumbnails in organiser?

    My raw images display only as the 'egg timer' icons in Organiser.  I can open them individually, edit and save as jpeg but cannot view them on the grid either before or after editing. This has only just started happening - two weeks ago all was well. It's such a nuisance not being able to scroll down my images in order to decide which ones to edit.
    Here's what I've tried:
    Uninstalled Elements 12 and reinstalled
    Checked for updates (all up to date)
    Updated thumbnails
    Usually what happens after my images are imported is that I see these icons and they gradually open to reveal my raw images.  Now they just stay with the timer icon and nothing more happens.
    Anyone help me before I tear out any more hair?  Thank you!

    If you can use the 'update thumbnail' successfully on individual files and open those files in ACR correctly chances are that you are facing a computer power problem. Creating a thumbnail in the Organizer means opening the image to create a reduced version. For raw files, that means reading the raw file (32 GB each for my Fuji raws...), converting it using the last settings in the xmp sidecar files, then creating the reduced thumbnail. Several seconds, even with a decent  computer.
    To get an idea of your problem, it would be good to know the type and size of your raw files and your computer specs.
    Contrary to other viewing softwares which only show the embedded jpeg thumbnail in the raw file, the organizer shows a real preview.
    Photoshop Elements (PSE) knowledge base.: How to correct hourglass (generic) thumbnail in Elements Organizer??

  • DNGs produced from Hasselblad .fff files display a different image in Bridge and Camera Raw

    Lately, not sure when this started exactly, Bridge CC (and Camera RAW 8.7) are displaying incorrect DNG images!  Instead of showing the image I expect to see, I'll see an old image from days ago.  This seems to carry on from Bridge through to Camera RAW.  But then if I continue on to Photoshop with the image, it'll finally show the correct image. 
    I'm assuming this has something to do with DNG, because if I load another raw file type (like .fff or .NEF), it seems ok.  Also it seems to be ok with DNGs produced from other cameras like Nikon D90.
    My set up:
    - Mac OS X 10.9.5 (Mavericks)
    - Bridge CC
    - Camera Raw 8.7
    - Photoshop CC 2014
    - Hasselblad H4D-50

    HI, I managed to fix the trouble by reinsatalling once again and running updates BEFORE opening bridge. It seemed that if I ran the update AFTER opening bridge I would get either an up to date status when checking for updates or I would get an install failure notice on all 4 updates that were trying to install. The updates were for camera raw, bridge and PS. I can't explain why but that helped a little. I also changed permissions on my whole user accnt to include read/write for all users. I can't say if this helped or not. I also had to go into my camera B/U files on a sepate HD and replace some of the CR folders I was using o nthe desktop. Still the CR files would not show a thumb nor a preview till I then went to each individual file inside that folder and purged the cashe for that file so it could repopulate the cashe yet again. This has been the strangest few days in PSCS6 history! Well my personal history. I will report back here if more quirks emerge. I would prefer quarks though....aloha, U

  • RAW images stopped displaying!!

    Help--all of a sudden I get the maroon screen & unsupported format when I look at RAW images that have previously displayed without any problem. I haven't installed any new 3rd party apps.
    G5 2.3DP   Mac OS X (10.4)   Aperture 1.5.2

    quit aperture ... delete .plist ... restart aperture ...
    if that doesn't work, reboot ...

  • RAW images are not displayed

    I noticed today that one of my albums containing old RAW images (3 years old) are not shown in the preview. The images have been modified in an older version of iPhoto, but the change is gone. I can still open through Photoshop or iPhoto but do not see the edited version anymore ... Does anyone have a clue why?

    Canon PS 9, 10 Canon EOS 300D, 40D ... all my previous cameras, but not all images. As said, there seems to be no rule. Some pictures in the middle of a "roll". But sometimes several events in succession. All images can be opened in Preview. All images can be displayed in the Finder and iPhoto QuickView. If I want to show the images in the preview, are shows the unedited version. If I want to edit the pictures back into iPhoto, then the old edits will become visible again (for some pictures) but they can not be saved.
    I have about 35,000 photos in the library, spread over about 1600 events.

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

  • Why do tumbnails of RAW images no longer display?

    Just got a new camera (Sony a77) and when I took test shots and downloaded them to my computer, the tumbnails do not appear in CS3 Bridge?  Only as the stock RAW image.  My system is Mac OS X 10.5.8.  I also downloaded the included Sony CD Image Data Converter.  The thumbnail display was the same before and after I downloaded the IDC and when I right click on the tumbnail it is no longer an option for me to 'Open with Camera RAW'. I want it back-I need help!! and quickly!

    The free Adobe DNG Converter is a stand-alone application that you need to install, then launch and run it just like you would any other application (like Photoshop itself) on each batch of Sony raw files you need to convert.  It will then generate DNG raw files (DN = digital negative) as copies, leaving your Sony raw files untouched.  You can then open them in your current Photoshop and ACR combination.
    DNG files have been supported ever since Photoshop CS (that's Photoshop 8 a.k.a. Photoshop CS1) and ACR 2.4.
    Remember:
    Download the free, Adobe DNG Converter 8.3 (NOT higher, or it won't run in your Mac OSX  Leopard 10.5.8).
    On the other hand, if your client demands raw files, then why not give the client your Sony raw files?  Maybe you and/or your client are under a misconception as to the nature of raw files. 
    If this is a one-time situation, you could download a free, current, 30-day trial copy of Photoshop CS6 or Photoshop CC just for this one job.  But if the client wants unedited, true RAW files, I don't see the point.
    Incidentally, the files are generated by the application you're using at any one time to view or browse the raw files, they are not embedded in the raw files themselves.

  • Displaying RAW Image

    Can someone point me to some Java open source? I need to display all RAW format images (Ex: RAW, CR2, ARW, TIFF etc.,) Thanks.
    1) JAI seems to support only TIFF formats.
    2) jrawio project seems to have lot of bugs still outstanding http://bluemarine.tidalwave.it/issues/secure/IssueNavigator.jspa?reset=true&mode=hide&pid=10000&sorter/order=DESC&sorter/field=priority&resolution=-1&component=10078
    3) I do found a native one - http://www.cybercom.net/~dcoffin/dcraw/ but looking for a pure Java based one to handle all type of RAW images.

    mauriceb wrote:
    It does not look like SUN has any focus/plan to have similar API/Utility like this. Nor should they. Why do you think that this should be part of the core library of a general purpose programming language? Can you name any other wide-spread general-purpose programming language that has this functionality as part of its core library?
    Does anyone know any such utility written purely in Java? I indeed want to stay away from Native Library/code.If Google doesn't give you the results you're looking for, then it looks like you'll have no choice but to either roll your own or use the JNI.
    Good luck.

  • CR2 / RAW images no longer displayed

    For some reason, I can no longer view CR2 / RAW images (from a Canon EOS 350D). I've never had any issues with them before. Any ideas what can have caused this?

    Go into "System Preferences" -> "Software Update" -> "Installed Software" and verify that "Digital Camera Raw Compatibility Update" ver 2.7 is installed.
    Also... it will only read .CR2 files in true full 'RAW' format.... not 'mRAW' or 'sRAW'. This is not a bug... 'mRAW' and 'sRAW' are not intended to be supported as they aren't really RAW formats at all.

  • Canon RAW images displaying color borders at contrast edges

    I noticed annoying color borders in RAW images taken from my Canon PowerShot S120. They look like the color planes are misaligned. Around high contrast areas (between light and dark grey) I can notice magenta borders in one direction and cyan borders in the opposite direction, both approximately 5 pixels wide.
    I record and store images as RAW+JPEG pairs. In Aperture I set RAW as master.
    In the original JPEG of the image pair from the camera this error is absent, the color is neutral on both contrast edges.
    The error in the RAW image can also be seen when the file is opened directly in Preview or if the RAW image is exported to a TIFF using Aperture and then opened with Preview.
    I compared this to older RAW+JPEG image pairs I took with the previous model, a Canon PowerShot S90. There I see yellow and blue borders in opposite directions in Aperture or Preview, also approximately 5 pixels wide. In the camera's original JPEG image from the image pair this is still a bit visible, but far less pronounced.
    My oldest RAW images taken with a Nikon E8800 (.NEF) don't show such artifacts when viewed in Aperture.
    Since the JPEG from the pair does not have these artefacts my guess is that the RAW converter is not optimal or some metadata in the Canon RAW files (.CR2) is either missing (worst case) or not used correctly.
    My hope is that I just have to adjust some presets to correct this. Else it is probably up to Canon or Apple.
    Does anyone know how to fix this issue (without going through the individual files, if possible)?

    Hi Keith
    Thanks for the infos.
    Just to clarify:
    I didn't ask for RAW, I just use raw formats because there's curretly no better alternative. I would like to see what came into the lens - like an ideal hole camera . Ordinary JPEG is way too limited (8bit resolution per color channel plus really ugly compression artefacts).
    For archiving I would much prefer the JPEG2000 format with lossless encoding and as many bits per pixel as the camera's analog to digital converters provide, linearly encoded (above the noise background but including one bit of noise, to be precise). But, alas, when I did my last experiments (Snow Leopard) the image framework in Mac OS X did still not support more than 8bit resolution per color channel in JPEG2000.
    One good thing about raw formats is that the corrections could actually be better than what is always done by the camera's firmware for JPEG or standard TIFF at the time of the shot. Another good thing is that various sensor and color patterns can be handled directly.
    If Canon can do it in DPP, then I strongly hope they will also provide a better converter for Mac OS X. On some pictures this aberrations are really obvious and irritating.

  • How can I edit a RAW image in Adobe Bridge and/or Photoshop?

    Whenever I drag and drop a photo or group of images from iPhoto. it automatically converts them to jpegs. Even when taken as RAW images. With iPhoto 09, you could do a search of the IMG_#### listed in iPhoto, and a normally-hidden folder full of the original downloaded RAW images turned up in the search. Now, in iPhoto 11, the RAW images newly downloaded DO NOT show up in any system searches (using 10.8.4. It was bad enough when they were hidden... now they are virtually gone.
    I want to use iPhoto for organization and some editing, but some photos I want to work with in the RAW format and save as TIFFs. How do I do that?

    Whenever I drag and drop a photo or group of images from iPhoto. it automatically converts them to jpegs.
    Drag and Drop and Media Browsers access the iPhoto Previews only. No conversion, just the previews.
    With 10.8 Spotlight no longer searches within packages, that's to protect the inexperienced user from trashing his or her library inadvertently - as directly accessing the file can do.
    To use Raws with an external editor:
    First off set your preferred app as an external editor in iPhoto:
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    Next: In the iPhoto Preferences -> Advanced, elect to use Raw with your External editor:
    Now when you go to edit the Raw it will be sent to your external editor.
    But there's a kludge here.
    iPhoto sends a copy of the file to Photoshop. In the case of a Jpeg you simply save and it all comes back to iPhoto seamlessly. However, if you use a Save As then Photoshop is creating a new file and iPhoto knows nothing about this.
    Now here's the catch with Raws. You cannot save a Raw. The work you do must be output to a new file, in a new format (jepg, tiff, whatever). However, as the External Editor is making this new file iPhoto has no knowledge of its existence. Therefore you must save it to the desktop and then import it back to iPhoto as a new file.
    This means that you will have your Original Raw and the processed version in iPhoto but they will not be recognised as version and original. iPhoto will see them as two separate shots.

Maybe you are looking for

  • Apparent kompare bug(s)

    I apologise in advance for the length of this 1st-Arch-post-in-years. I value context more than brevity, I guess. Hopefully this is the longest post I'll throw at Arch for a long, long time. I looked around (quite) a bit before filing this post.  I'v

  • AE is too heavy and how make it 'light'

    hello guuysssss! im working right now and im a some clip with a bunch of layers and each layer has a large size. im mad because everytime i tried to preview my clip it takes many times because is so heavy. how do i make this stuff more light for prev

  • How does one edit a song? ...meaning,get rid of voices but leave the music?

    ...i know that this is this is the wrong forum and i should be in garageband forum (i think) ... .....but my daughter is in figureskating and i have a song picked out but i want to edit it so the singing voice is gone but the instuments/music is all

  • Facing issues while executing LDAPBind command in Unix

    Dear All, We are trying to invoke a shell script from PeopleCode(which is having the ldapbind command) through exec command. We are able to invoke the shell script but the ldapbind command fails to execute. It throws the below error +"/usr/bin/ldapbi

  • Flash playing slow in Adobe Connect 8 Content

    We are being upgraded to Adobe Connect 8 next week.  WE have a temporary Adobe Connect 8 and playing with it we find that when we load a flash file intro a Content area, it gives us the standard URL but if you try to play the video it just does not s