BufferedImage from JPG File???

Hello,
Does anyone know how to make a BufferedImage object from a file like a
GIF or JPG? Please give me some code.. Thanks so much.
Charlie

You got it wrong:
Image image = getToolkit().getImage(name.jpg);
int imageWidth = image.getWidth(null);
int imageHeight = image.getHeight(null);
BuffereedImage imageBuffer = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
Graphics2 graphics = imageBuffer.getGraphics();
graphics.drawImage(image, 0, 0, null);
noah

Similar Messages

  • DNG Profile Editor: Can't create profile from JPG file

    Guys, could you tell me why DNG Profile Editor fails to create color table using 4 colored circles ? It says "Unable to check white balance using gray patches. Please use the four color circles to identify the four corner patches of the chart and try again" even though I places four circles properly (it works with DNG files shot with my Nikon D700).
    I created this DNG file from JPG file by opening it in Camera Raw plugin and saving as DNG file. Original JPG was shot on camera of Samsun Galaxy S phone. I know I'm crazy but I want to have color profile for it All patches are properly exposed after slight correction of Exposure slider in Camera Raw.
    I'm using latest beta3 build
    Here is link to DNG and JPG file I'm trying to use
    http://www.box.net/shared/4v2rzlzjfp
    Thanks!

    If you convert your JPG to a DNG can you change the profile to the one you computed from the other JPG you converted to a DNG?
    Profiles are not for JPGs.  Profiles are for RAW files that ACR supports.  You can't (easily/ever) get a RAW file from your Galaxy S and Adobe doesn’t' support that RAW format even if you could.
    To see if your profiling is working, you can used the ColorCheck module from a trial version of Imatest that you download from www.imatest.com and look at the color-error.
    You can also try the Read_Color_CC24.jsx script from Rags-Gardner:
    http://www.rags-int-inc.com/PhotoTechStuff/ColorCalibration/

  • BufferedImage from jpg

    Anyone know how to make a BufferedImage object from a file like a gif or jpg? thanks

    yeah, but don't use TYPE_3BYTE_BGR, it has a component color model, so is slow :-P
    use TYPE_INT_BGR, TYPE_INT_RGB,(direct colormodels)
    or TYPE_INT_RGBA if u want an alphachannel.
    rob,
    Image  image;
    image  = getToolkit().getImage("f4.gif");
    MediaTracker tracker = new MediaTracker(this);
    tracker.addImage(image,0);
    try
         tracker.waitForID(0);
    catch (InterruptedException e){}
    BufferedImage bI = new
    BufferedImage(image.getWidth(),Image.getHeight(null,Buf
    eredImage.TYPE_3BYTE_BGR);
    Graphics      g  = bI.getGraphics();
    g.drawImage(image,0,0,null);Noah

  • Creating PDF from JPG files

    I scan several pages from a book and wish to compile a PDF file from the scanned JPG files. What I want is the PDF file to be as small as possible, using relatively good JPG files (they are on the order of 300k), so that the fonts don't look too blurry when magnifying the image in Acrobat. My PDF file gets to be very big when creating a file composed of around 100 scanned pages. How can I make the file smaller?
    I can't use optical character recognition to convert the text of the page. Much of the text contains mathematical symbols and figures, but is generally just black-and-white.
    I feel the large file size of the resultant PDF file is due to all the "white space" of the JPG file. Is there some way to have Acrobat "ignore" the white when creating the PDF file, and then just display the information part of the JPG file on a white background?
    Remember, I'm creating a PDF file from scanned textbook pages, not photographs. I would think that there is an optimum way to do this, keeping good resolution of the text (the "black" or non-white information), and minimizing the file size of the resultant PDF file.
    Any thoughts?
    I have Acrobat 8, Photshop Elements 6, and Windows Vista Ultimate.
    Thanks

    For starters, you should be sure and scan them as grayscale. Then the "white space" won't be an issue.
    Basically the answer is going to be in your initial scan. You need to optimize the files as best you can there first then create the PDF.

  • Unable to SAVE AS psd from jpg file

    Recently installed PE 6.0 on Windows XP. After working on a photo in Quick Fix or Edit, when I select SAVE AS psd and then close, the supposedly saved file appears in the organizer as a torn-photo icon and then its properties are listed as ".jpg". So it looks like the jpg format was not changed to psd, and also that the photo is lost. Saving as jpg works fine. Any suggestions are most appreciated.

    Thanks for your time and advice, Barbara. This is what happened:
    First, I restarted editor while grabbing ctrl+alt+shift, and I got the delete settings query and clicked yes. This did not make a difference. Then, I started playing with blank files. After experimenting for a couple hours, I have found this: If I Save As in the File menu, and then CHANGE the format, AND change the title, it works to go from JPEG to PSD or the other way around, and the thumbnail in the organizer is normal and its properties reflect the change. However, if the title of the file is unchanged and I attempt the same thing, is when it doesn't work. Switching formats seems to depend on making a title change. Thanks again for your help.

  • How to create ICon/Cursor from pdf files

         I was able to create ICon from jpg file without problem but I couldn't create ICon from pdf files.
    Here my code:
    var myDoc = app.newDoc();
    myDoc.importIcon("myIcon"); // it worked when I chose a jpeg image, but it didn't
    //when chose a pdf file.
    icon = myDoc.getIcon("myIcon");
    oIcon = util.iconStreamFromIcon(icon);  
    myDoc.closeDoc(true);
    app.addToolButton({
                   cName: "myButtoon",
                   oIcon: oIcon,
                   cExec: "app.alert('Someone pressed me!')",
                   cTooltext: "Push Me!",
                   cEnable: true,     
                   nPos: 4
       //app.removeToolButton("myButtoon");
    My goal is to create buttons which have icons from a pdf file (stamp) and when user click on these buttons, the cursors become the icon . And then, when user click on the document, the iCon will be showed in the document. The point is: is there anyway to create icons/cursors/stamps from one pdf file. Because the stamp is changeable, when user changes the color/shape of the pdf file, the icons/cursors/stamps will automatically change
    What kind of pdf format do I have to use?
    I used the sample "SignHere.pdf" in stamps folder of Acrobat but it didn't work.
    Thanks.

    The SDK has all the information - but certainly there are only samples for those common actions that users have been doing for years.  Most developers don't recreate stuff already present in the application - such as the Stamp plugin - so we don't have samples of such things.
    But all the pieces you need are present in the SDK - it's just necessary obvious.  You will need to learn about the details of how the plugin APIs work to create the toolbars and toolbuttons, and then how to handle cursors.  You will then need to learn about PDF details in order to be able to take an existing PDF, potentially modify it (eg. Change the color(s)) and then place it onto another PDF.  
    The methods you listed are from JavaScript - there are alternative methods for plugins, such as the AVConversion APIs.

  • How can I delete two .jpg files from my desktop that refuse to be deleted?

    How can I delete two .jpg files from my desktop that refuse to be deleted?

    The two icons refused to be moved to the garbage. The good part in all this is that ater I turned off the computer at night and turned it back on the next morning they were gone!
    Thanks.

  • How do I create a photo in jpg or other photo format from a frame within iMovie11.  The suggestion I have found from earlier versions of iMovie does not create a jpg file that can be revealed in Finder. Help please.

    How do I create a photo in jpg or other photo format from a frame in iMovie. The previous suggestions on here do not create a jpg file when you chose reveal in finder when using iMovie11 and OS X

    First, get an app called MPEG Streamclip, which is free. (google MPEG Streamclip from Squared 5)
    Open MPEG Streamclip.
    In iMovie, select the clip you need. Then, right-click/Reveal in Finder.
    Drag this clip into MPEG Streamclip
    In MPEG Streamclip, move the playhead to the frame you want.
    In MPEG Streamclip, click FILE/EXPORT FRAME.
    Choose JPEG, TIFF, or PNG and give it a name.
    You can then drag this photo into iPhoto.
    Here is a video I made that steps through this...
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • How to insert a JPG file from file system to Oracle 10g?

    I have developed a schema to store photos as BLOB which store the text description as CLOB original filename, file size.
    I also use ctxsys.context to index TEXT_DESCRIPTION in order to perform Oracle Text Search and it works.
    I would like to insert some JPG file from say C:\MYPHOTO\Photo1.jpg as a new record. How can I do this in SQL PLus and/or Loader?
    How can I retrieve the PHOTO_IMAGE back to the file system using SQL Plus and/or command line in DOS?
    See the following script:
    create user myphoto identified by myphoto;
    grant connect, resource, ctxapp to myphoto;
    connect myphoto/myphoto@orcl;
    PROMPT Creating Table PHOTOS
    CREATE TABLE PHOTOS
    (PHOTO_ID VARCHAR2(15) NOT NULL,
    PHOTO_IMAGE BLOB,
    TEXT_DESCRIPTION CLOB,
    FILENAME VARCHAR2(50),
    FILE_SIZE NUMBER NOT NULL,
    CONSTRAINT PK_PHOTOS PRIMARY KEY (PHOTO_ID)
    create index idx_photos_text_desc on
    PHOTOS(TEXT_DESCRIPTION) indextype is ctxsys.context;
    INSERT INTO PHOTOS VALUES
    ('P00000000000001', empty_blob(), empty_clob(),
    'SCGP1.JPG',100);
    INSERT INTO PHOTOS VALUES
    ('P00000000000002', empty_blob(), 'Cold Play with me at the concert in Melbourne 2005',
    'COLDPLAY1.JPG',200);
    INSERT INTO PHOTOS VALUES
    ('P00000000000003', empty_blob(), 'My parents in Melbourne 2001',
    'COLDPLAY1.JPG',200);
    EXEC CTX_DDL.SYNC_INDEX('idx_photos_text_desc');
    SELECT PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS;
    SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS
    WHERE CONTAINS(TEXT_DESCRIPTION,'parents',1)> 0
    ORDER BY score(1) DESC;
    SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS
    WHERE CONTAINS(TEXT_DESCRIPTION,'cold play',1)> 0
    ORDER BY score(1) DESC;
    SELECT score(1),score(2), PHOTO_ID ,TEXT_DESCRIPTION
    FROM photos
    WHERE CONTAINS(TEXT_DESCRIPTION,'Melbourne',1)> 0
    AND CONTAINS(TEXT_DESCRIPTION,'2005',2)> 0
    ORDER BY score(1) DESC;

    Hi
    You can use the following to insert an image:
    create table imagetab(id number primary key,imagfile blob, fcol varchar2(10));
    create or replace directory imagefiles as 'c:\'
    declare
        v_bfile BFILE;
        v_blob  BLOB;
      begin
        insert into imagetab (id,imagfile,fcol)
        values (3,empty_blob(),'BINARY')
        return imagfile into v_blob;
        v_bfile := BFILENAME ('IMAGEFILES', 'MyImage.JPG');
        Dbms_Lob.fileopen (v_bfile, Dbms_Lob.File_Readonly);
        Dbms_Lob.Loadfromfile (v_blob, v_bfile, Dbms_Lob.Getlength(v_bfile));
        Dbms_Lob.Fileclose(v_bfile);
        commit;
      end;
    /

  • Can No Longer Drag JPG files From Finder Directly Into .fla Stage?

    For the past six months I have been following a manual process to convert JPG files (exported from InDesign) into SWF files for display advertising assets. 
    Using pre-built FLA files as templates (configured with clicktags):
    Open FLA templates (3 separate files for 3 IAB ad sizes)
    Drag JPG from Finder directly into stage of FLA file, aligned to
    Publish to output folder for renaming
    Today, for no apparent reason, I can no longer drag anything into the stage of any FLA file.  Not just the pre-built templates.  Nothing will drag & drop into an FLA stage. 
    What I have tried:
    Restarted Mac
    Reset Flash preferences
    What I know I can still do:
    Drag files from Finder into the Library, and drag into FLA stage from there
    "File > Import to Stage..."
    This works but because of my naming convention it prompts to import them all each time because Flash sees the sequence
    This is not another step I am willing to contend with for my manual workflow
    Me and my creative team need to process hundreds of assets like this each week, so I'm very anxious to discover why functionality that was working, suddenly stopped.
    Running:
    MacBookPro Retina OS X 10.8.5
    Flash CS6 v. 12.0.2.529

    just want to add my annoyance to the pile here. I can't see any logic behind removing the drag and drop function, especially when adding a new folder is now a multi-step process that is far from obvious. to start a new playlist with local folder content you now need to:enter settingsclick into advanced settings (basically all settings now seem to be "advanced"?)manually find and add the foldergo through the adventure of finding the files in your library.
    -- because they may or may not be listed under "local files" - you won't know because Ctrl+F is also removed. so you have to remember/know what the album you added is called and search for that. if you have a mixed bag of file names from various albums, you're basically shafted; there's no way to find them all with a single search.then you can add them to playlisteta: but wait! there's more! if you have more than 15 files? you're **bleep** out of luck, because the search will only display the first 15 hits among your local files, and then show you spotify library tracks.I can't help but feel as though spotify is doing everything they can to stop us using spotify to listen to local files, as bugs that make it more or less impossible persist through multiple versions - and now features that seem to me to be basic functionality are being removed?mega minus points from someone who's been using spotify since 2008.

  • How do i transfer jpg files from outlook to iphoto

    how do I transfer multiple .jpg files from outlook to iphoto very easily?

    This may be a stupid suggestion.... Drag and Drop... Drag the jpeg's from the outlook window and drop them inside the iPhoto window.

  • How to improve the resolution of jpg files in a pdf created from html

    I have a document in html that I need to convert to pdf. If I open the html in acrobat, the images look fine, almost the same as if I open the file in a browser. If I do "create pdf from web page", the jpg files imbedded in the html look terrible in the resulting pdf. Where can I adjust the resolution settings so that the jpg images look better in the pdf?
    I need to use "create pdf from web page" because I need access to the options to change the page size, margins, and header/footer, which I can't seem to find when I just open an html file and save as pdf, etc.
    LHH_enc

    Do you have a particular URL that we can look at to see where the problem might be? As far as adusting margins and such from your browser, those would be in the browser print settings to provide that option. You also would need to check possibly to use the Print or Press settings file to get better graphic resolution. The settings file selection may also be important if you use PDF Maker in one of the browsers that use PDF Maker.

  • Camera Raw won't open certain JPG files from Bridge, others open in ACR with no problem.

    Edit: This was orignally posted in the Photoshop > Macintosh forum, which I failed to realize was read only. Thanks to a PM headsup, I'm reposting it here. Thanks
    I've searched the internet and the Adobe forums and cannot find a direct answer to what I'm dealing with.
    The issue I am having is that Bridge CS5 (current version 4.0.5.11) will open some JPG images in Raw with no problem and others nothing happens at all. All the images come from the same source (Fujifilm Frontier SP2000) so I really don't understand why Bridge ignores some of them as being openable in RAW. For example, say this roll of film has 36 images. If I "Select All", right click, and select "Open in Camera Raw", it will open whichever it deems acceptable in RAW and nothing happens at all to the others (The RAW dialog will, for instance, only open 10 images instead of all 36, and the remaining images are not altered in any way).
    I've made sure that Photoshop is prefering Adobe Camera Raw with Supported Raw Files and in Camera Raw Preferences I have the box ticked to Automatically open JPGs with Settings but nothing helps.
    My work around is to one file at a time in the Photoshop Open dialog, selecting an affected JPG file and have it open them as Camera Raw instead of Jpeg.
    Any ideas? It's done this for quite a while and I have no idea how to fix it.
    Thanks.
    Cary

    Cary,
    It could be an insufficient memory problem.  Please supply details about your machine.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers: 
    http://forums.adobe.com/thread/419981?tstart=0
    Also, please note that the Camera Raw forum is here:
    http://forums.adobe.com/community/cameraraw
    Thanks!
    Wo Tai Lao Le
    我太老了

  • Importing jpg files from hard drive

    I am trying to import all my pictures into iphoto however am getting an error:
    Unreadable file, The following file cannot be imported. (import failed).
    The files I am importing are *.jpg files from various camera I have owned over 5 years. I have all the photos uploaded into my apple TV as well as being very easily readable through other picture viewers on my Mac. I cant seem to understand why it would not import into iphoto.
    Please can somebody help me if you have ever had this issue before.

    Welcome to the Apple Discussions. Try copying a few to the desktop and from there into iPhoto. If that is successful then there's something about being on the Apple TV drive that iPhoto doesn't like. If that's the case you may have to copy the photos to the desktop, import into iPhoto and then delete them from the desktop.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There's now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • Problem printing PDF picture files imported from JPG using HP Colour InkJet cp1700 printer

    When I print PDF picture files imported from JPG using an HP Colour InkJet cp1700 printer, the picture spills over.  A wide range of other PDF files print OK.  Have tried things such as configuring the printer to scale to letter size, etc,, but without success.  Have a Windows 7 64 bit computer and Adobe Acrobat Pro Extended 9.5.5.  Any ideas?

    Hello there! Welcome to the forums @rt70 
    I understand you're having some issues with printing PDF files from a website on Windows 7.
    I would personally suggest trying to print from that website using a different web browser. If you're using Internet Explorer, try FireFox or Chrome, for example.
    You can also try running the Print and Scan Doctor tool, that will search and try and fix printing issues.
    If you have any issues that continue, please let me know what they are and which programs, websites, and web browsers you have tried, along with the results from running the diagnostic tool above.
    Good luck and have a great day
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

Maybe you are looking for

  • Error while loading data from DataSource to InfoCube/DSO through DTP

    Hi Friends, I am trying to load data from DataSource to InfoCube/DSO through DTP and getting the following error: Exception in substep: Extraction completed Processing terminated Data package 1 / 30.04.2009 22:38:30 / Status 'Processed with Errors' W

  • How to populate the CST and VAT registration no  in billing.

    Hello Gurus , Goodevening , How to populate VAT NO  and CST NO  of Customer and Company in the invoice of the customer. Looking for your inputs Regards Ravi.M

  • HP C6280 prints gibberish/special characters

    HP Photosmart 6280 running on MS XP, USB connected.  Used to work fine, now when I try to print anything from anywhere it wastes paper by printing gibberish. It takes pages and pages to get one good print. I also get a computer message that says prin

  • HTC Incredible stuck, Wont boot

    I just got my phone literally 5 hours ago, I just got everything set up, contacts added, Etc, I go to plug it into my computer to put some music onto the phone and the phone just shuts off, I go to turn it on and it stays at the "HTC Incredible" scre

  • Deleting records from sys.aud$ from stored procedure

    We have a stored procedure that is trying to move records from the sys.aud$ table to a historical table (in an attempt to keep sys.aud$ to a more manageable size, I guess -- full disclosure I did not write this proc). The basic flow is: select count(