Image to jpeg

From an object java.awt.Image I must obtain an object byte[] type that have to
contain an jpeg imaging type. For doing that I am using the attached code but it
is very slow when it is in execution and it use a lot of energy from the
system. How can i do in order to obtain the same result most quickly?
Thank for you help.
javax.media.Buffer buffergrabber= frameGrabber.grabFrame();
java.awt.Image image= (new javax.media.util.BufferToImage((javax.media.format.VideoFormat)buffergrabber.getFormat()).createImage(buffergrabber));
int pix[]= new int[image.getWidth(null) * image.getHeight(null)];
java.awt.image.PixelGrabber pg= new java.awt.image.PixelGrabber(image, 0, 0, image.getWidth(null), image.getHeight(null), pix, 0, image.getWidth(null));
pg.grabPixels();
java.awt.image.BufferedImage bufferedimage= new java.awt.image.BufferedImage(image.getWidth(null), image.getHeight(null), java.awt.image.BufferedImage.TYPE_INT_RGB);
for (int count= 0; count< image.getHeight(null); count++) {
    for (int count_2= 0; count_2< image.getWidth(null); count_2++) {
        bufferedimage.setRGB(count_2, count, pix[count * image.getWidth(null)+ count_2]);
try {
    java.io.ByteArrayOutputStream bytearrayoutputstream= new java.io.ByteArrayOutputStream();
    com.sun.image.codec.jpeg.JPEGImageEncoder imageencoder= com.sun.image.codec.jpeg.JPEGCodec.createJPEGEncoder(bytearrayoutputstream);
    com.sun.image.codec.jpeg.JPEGEncodeParam encoderparam= imageencoder.getDefaultJPEGEncodeParam(bufferedimage);
    imageencoder.setJPEGEncodeParam(encoderparam);
    encoderparam.setQuality(1.0F, true);
    imageencoder.encode(bufferedimage);
    byte MyJPEGImage[]= bytearrayoutputstream.toByteArray();
catch(java.io.IOException e) {
    System.out.println(e);
}

Best to use the original.
If youv lost it, remove any other objects over the image and size the image to fill the slide, then use export.

Similar Messages

  • Mail will not display images with .jpeg extension. .jpg works fine. (displays in place when opening the email. What plug-in would correct this?

    Mail will not display images with .jpeg extension. .jpg works fine. (displays in place when opening the email. What plug-in would correct this?

    If you think you're insane now, try maintaining those pop up menus.
    As far as I know, these menus have not been updated since FW 8, so 
    they are at least two versions old.
    Save yourself a lot of grief by avoiding those menus. There are many 
    other products on the market which do a much better job of creating 
    and maintaining this type of navigation structure.
    Read this link before you climb any higher on this slippery slope:
    http://apptools.com/rants/jsmenu.php
    There was another blog post by the fellow who originally wrote the pop 
    up menu feature, but I can't seem to locate it. Even he says stay away 
    from them.
    Not the answer you probably want, but I hope it helps, nonetheless.
    Jim Babbage

  • How to get import com.sun.image.codec.jpeg.*;..Help..

    I’m doing a research for video compression n I need to compress the frame as image, I want to use com.sun.image.codec.jpeg.* , but I can’t download the plugin every where. I use JDK 1.5.0 to do my java program. Does any one have a suggestion about my problem? What should I do, so I can use com.sun.image.codec.jpeg.*?
    thanks

    That is part of the following:
    [http://java.sun.com/javase/technologies/desktop/media/2D/]

  • I have problems with uploading images to my printing company have the images have been manipulated through CS6 i have saved images as jpeg but the printer company tell me they are not j peg, they will not upload images save from a camera are fine

    I have problems with uploading images to my internet printing company when  the images have been manipulated through CS6 and  i have saved images as jpeg  the printer company tell me they are not j peg,
    but images saved from my phone or camera images that have not been manipulated upload fine, What am i doing wrong?

    Save/Export them as JPG. Photoshop defaults to PSD, so make sure you select JPG and not just rename the file to .jpg.
    There are two ways to save them as JPG: Regular Save as option or Save for Web & Devices
    Take your pick.

  • How do I save modified RAW images in JPEG format?

    Hi,
    I have several RAW images that I mass modified with the "Camera Raw" editor (I modified one and applied the changes to all other images). How can I now save the modified images as JPEG images? I know I could open each file in Photoshop and save it as JPEG there, but that would take A LONG time.
    Thanks for any pointers!
         Mark

    They have to be opened, one by one, before the adjustments are applied and the image files saved, but the process can be automated.  For instance through the already included Image Processor, or Image Processor Pro, also pre-installed, or through Actions and Droplets you create yourself.

  • Converting raw images to jpegs using PSE 11

    I have started to capture only RAW images from my Sony NEX 7 camera. However, I wish to be able to send JPEG images to my friends ( prior to RAW editing ). How do I convert/copy my RAW images to JPEGs using PSE 11?
    Thanks
    Derek

    After you're done in camera raw (or in your case, without doing anything, but you'll just get the default conversion, because you MUST convert the files), click the Open button, then save in the format of your choice in the editor. JPEG is an 8 bit format so you will want to either set the raw converter's pulldown menu to 8 bits or you will need to go to Image>Mode> 8 bits/channel in the editor. If you're emailing, you can also use Save for Web to size them down if necesary.
    If you use the organizer, you can just use file>export as new files and be sure to send the jpgs someplace easy to find.

  • Tiff image with JPEG compression

    How does photoshop handle RGB and YCbCr as photometric interpretations of tiff image with JPEG compression?
    Are they same?

    Got no idea but here is a website with a adobe pdf answer.
    http://www.ask.com/web?q=How+does+photoshop+handle+RGB+and+YCbCr+as+photometric+interpreta tions+of+tiff+image+with+JPEG+compression%3F&search=&qsrc=0&o=0&l=dir

  • How do I change the raw image to jpeg with element 6

    How do I change the raw image to jpeg using element 6?  I am using a canon 10D camera.

    From the Editor choose:
    File >> Open
    Then navigate to your raw file
    When the image appears in the converter use the sliders to make your raw adjustments, then click open image.
    From the Editor use:
    File >> Save As >> jpeg
     

  • Does Web Module size and convert RAW images to jpeg?

    I have never used the Web module before. It looks pretty straightforward but I have one question:
    What about images? Does Lightroom take the original RAW images from the library that I've chosen to go into the web site and 'pare the down' or re-size them to be appropriate size for the web site and I assume it would also convert them to jpegs in sizes needed for preview and for thumbnails?
    I assume that when you start the 'machinery' for Lightroom to build the web site that it will put all of the images needed as copies from the originals into a proper folder that can be then uploaded to the web?
    Thanks,
    Ken
    PS: if I choose a flash template, which are pretty nice, does it also include the flash module so that people can run the flash presentation on their computers?

    It will convert all images to jpegs, resize ... however you set it up ... and yes, it is so straightforward as it seems to be .
    It makes no sense to upload RAW files to the web for public use in the first place. Second, LR does not touch/change the RAW files. Therefore, how would it be able to integrate your dev settings when using RAW on export?
    You can add the ftp target in LR and it will upload directly to your web server.
    If you choose Flash-based, people need to have the Adobe Flash player installed on their computer. The Flash player itself is not part of the LR setup. Most of people already have it installed and who doesnt will be asked to install it.

  • Converting PNG images to Jpeg

    I am operating with iPhoto 6.0.6 and have a lot of recent wedding photos that were sent to me in PNG format. How do I convert these images to jpeg? I've found lots of shareware for conversion but nothing that will run on a mac.

    Is there any reason to convert them? PNG is just as portable as JPEG.
    You can export png from iPhoto and choose JPEG as the destination format using the File -> Export command.
    Regards
    TD

  • Photoshop Elements 13 doesn't recognize Samsumg images not jpeg images even

    What  have I to do, becauce Photoshop Elements 13 doesn't recognize Samsung images?  I have Samsung camera so I need Photshop Elements 13 Organizer recognize Samsung images. Canon images it recognaze.

    Hi,
    there are two photos, the first SAM4434 is the photo which PSE 13 import
    correctly, the second photo SAM4113 is which PSE 13 can't import. There is
    the third enclose where is an information that PSE 13 doesn't import the
    photo because the photo is on Organizer or PSE 13 doesn't recognize a file.
    The information is in Finnish but the information is what I have translated
    on this e-mail. PSE 13 doesn't recognize the file because it is not on
    Organizer. The both photos has taken by Samsung NX200 camera, There have
    never been that kind of problem by Canon camera taken photos
    Best Regards,
    Pertti Hynninen
    Finland
    2014-10-13 8:52 GMT+03:00 andaleebfatima1 <[email protected]>:
        Photoshop Elements 13 doesn't recognize Samsumg images not jpeg
    images even  created by andaleebfatima1
    <https://forums.adobe.com/people/andaleebfatima1> in Photoshop Elements
    - View the full discussion
    <https://forums.adobe.com/message/6818793#6818793>

  • Problems Exporting RAW images to JPEG in Lightroom 1.1

    I have used LR 1.1 with much success in editing, then exporting/burning JPEG images.  But now, I am shooting in camera RAW (Nikon D40x), and when I attempt to export the edited images to JPEG files, I get the message that an error has occurred during export, and the files do not burn to jpeg.  What can I do to correct this?

    It will convert all images to jpegs, resize ... however you set it up ... and yes, it is so straightforward as it seems to be .
    It makes no sense to upload RAW files to the web for public use in the first place. Second, LR does not touch/change the RAW files. Therefore, how would it be able to integrate your dev settings when using RAW on export?
    You can add the ftp target in LR and it will upload directly to your web server.
    If you choose Flash-based, people need to have the Adobe Flash player installed on their computer. The Flash player itself is not part of the LR setup. Most of people already have it installed and who doesnt will be asked to install it.

  • How to save multiple images from jpeg to psd?

    I'm pretty new at this and have tons of vacation photos. Things I've read have left me terrified of leaving my images in jpeg, but I don't know how to save them all to .psd (and is that really the format I want to use?). I tried, and suddenly I'm out of space on my harddrive, so I think I've made copies of copies and have way more saved than I need. Any advice is appreciated - thanks.

    <[email protected]> wrote<br />> ...Things I've read have left me terrified of leaving my images in jpeg...<br /><br />Andrea,<br /><br />If the JPEG files are straight out of your camera, there is no harm in <br />"leaving" them as-is...  they don't degrade from just sitting there.<br /><br />The possible degradation of JPEG files comes from saving as a JPEG - <br />typically after you have done an edit to the image.<br /><br />One good way to approach the issue:  when you open an image for editing, <br />before you do anything, click the menu File > Save As...  and then choose <br />the PSD file type.  This will make a copy for you to work with, which will <br />NOT degrade as you save, re-edit, re-save, etc.  After you're finished <br />working it over, if you need a JPEG copy, use the File > Save As...  and <br />select JPEG to make an edited copy in the smaller file format.  (File > Save <br />For Web is also useful for this - it allows you to set your quality and size <br />parameters on-the-fly as you save)<br /><br />HTH,<br /><br />Byron

  • How to save applet in image(gif/jpeg) format

    Hi there !
    how to save applet in image (gif/jpeg) format. i have just gone through JIMI package where serilization is there ,WHERE U CAN SORE in image format ...........can anybudy help me out.........if possible then pleeez provide me some example.
    Thanks in advan...........

    I think that is possible because i have seen some commercial applets that do that.
    -http://www.izhuk.com/painter/
    -http://www.lawrencegoetz.com/programs/signature/
    Thses two saves the image in the server since applets cant write in the host they are running. Maybe it would be possible whit JFS, i don't know.
    For now I am trying to store an image draw in the applet on my server.
    My idea now is copying the image to a buffer or something, open a connection to the server and receive the image with a perl CGI.
    There is an example with text:
    -http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html
    I want to do something similar but with an image.

  • Package  com.sun.image.codec.jpeg

    i believe package com.sun.image.codec.jpeg does not come with the JDK...right ? where from i can download it ?
    However , i was surprised to see that JSP in tomcat is able to import
    <%@ page import="com.sun.image.codec.jpeg.*" %> // No ERROR !!

    thanks .....
    strange ......
    C:\tomcat\common\lib
    AND
    C:\tomcat\webapps\myapps\WEB-INF\lib
    No rt.jar is there .
    Anyway, where from it is downloaded if i want to use that pack ?

Maybe you are looking for

  • My macbook pro won't recognize network printer

    Macbook pro is late 2011 running OSX 10.7.5 - Lion, connected wirelessly to home network with airport express. Have an HP deskjet connected with a cable to a MacMini mid 2011 - Yosemite. macbook always has problems printing to this printer on home ne

  • Saving PDF forms in Adobe Reader 8 and below

    Hi everyone, I've created a PDF form for a survey using Acrobat XI Pro, and I've also Save As Other > Reader Extended PDF > Enable More Tools (includes form fill-in and save). I've tried it on Reader 9, X and XI, and I'm able to fill out the form, sa

  • How do I upload video from iphone to Mobileme WITHOUT compression?

    When I upload to mobileme, video gets automatically compressed. I understand it if I am on 3G, but if I am using Wifi, why can't I upload from my iphone the full size video? There is nowhere to adjust the settings to prevent compression. Any help is

  • Nokia Big Screen has Small Resolution

    Am using Nokia Phone Broswer 2 together with Nokia Big Screen for HDMI connectio to TV set. This produces low-resolution iamges on the TV screen, as if the phone browser choses a resolution for its own screen and is not aware of the Big Screen. I sug

  • How can I return my photos from my passport backup to my macbook pro?

    Somehow I have lost my photo library- hopefully it is all on my passport back up- question is, how do I get it from the passport back to the macbook? Thanks!