Save image to a JPEG format?

Dear All,
1. I have a float array containing pixel values. From that array I want to create an image (let's say in JPEG format).
How should I do that?
2. If I get a TiledImage (JAI package), how should I save it using to JPEG format?
thanks

What about continuing in your other threads?
http://forum.java.sun.com/thread.jspa?threadID=665934&messageID=3898160#3898160
http://forum.java.sun.com/thread.jspa?threadID=665488&messageID=3896085#3896085
http://forum.java.sun.com/thread.jspa?threadID=664605&messageID=3892317#3892317
...and you should never cross-post questions.
/Kaj

Similar Messages

  • How do I save my video in jpeg format so I can add picture to it and burn a DVD through Photo Explosion version 4

    How do I save my video in jpeg format so I can add picture to it and burn a DVD through Photo Explosion version 4

    LRP
    Thanks for the follow up.
    In Premiere Elements 13/13.1, your export choices are in the Publish+Share section of the project. There are several choices and sub-choices.
    Example: Publish+Share/Computer/and then a list of choices under that, such as, MPEG, AVI, AVCHD, XAVC-S, Windows Media, QuickTime, Image, Audio.
    And each has Presets which define the export settings. Adobe offers default settings which are usually optimized ones. But, it also allows you to customize the preset selected. You do that by clicking on the Advanced Button of the selected preset and customizing the settings under the Video Tab, Audio Tab, and, if applicable, Multiplexer Tab.
    From what you wrote, I thought that you might be asking about exporting a video with a video codec = Photo JPEG.
    To do that you would to to
    Publish+Share
    Computer
    QuickTime
    with Presets = either the one for 4:3 of 16:9 as appropriate for your project,
    and then clicking on the Advanced Button, and then the Video Tab under the Advanced Button.
    Then selecting Photo JPEG for the video codec field.
    Tip: The QuickTime choice is not seen unless you scroll down the list of Computer choices. Use the thin scroll bar to the right of the Computer choices.
    Please explore Premiere Elements 13/13.1's Publish+Share/Disc/DVD with standard or widescreen preset for your creation of the DVD-VIDEO on DVD disc.
    The Premiere Elements timeline destined for this choice could consistent of supported photos and or videos.
    Please consider.
    Any questions and need clarification, please do not hesitate to ask.
    ATR

  • Is save for web in JPEG format lossless when quality is 100%?

    I am trying to figure out if I can reduce optimised JPEG sizes further than what Photoshop can offer.
    My boss has recently questioned whether the file sizes can be reduced using lossless JPEG's further than the sace for web function in photoshop.
    From what I can make of it, lossy is the option on GIF files, and therefore I am assuming that the optimisation is lossless for a JPEG at 100 percent quality and lossy when the quality is reduced?
    I just want to clarify that I am saving images for the web at the smallest size I can without losing too much quality.
    All the images I save are 450px wide @ 75 dpi, but vary in length from 800px high to 1500px high, but have to be saved under 100kb.
    Can anyone clarify the lossless and lossy in JPEG format in save for web?
    Thanks
    Ray

    As c. says above, JPEG is a lossy compression - there is no lossless JPEG.
    PNG 24bit offers lossless compression, that is it performs compression analogous to a zip archive, whereas JPEG works by (in extremely lay terms) building a new image that resembles the original.
    GIF and PNG exports let you reduce the number of colours to get better compression - there are fewer pixel differences to compress at 8bit colour depth. Hence a 16 colour PNG will have a vastly smaller file size than a 24bit PNG, and depending on the image may be much smaller than a similar quality JPEG.
    Depending on how far off your 100KB ceiling you are, you may be able to improve your file exports by cleaning up the source image - reduce noise and if possible explore exporting as 8bit pngs with fewer colours - avoid using diffusion or noise in the export options. Find the balance between acceptable file size and image quality... photographs tend to be the hardest thing to compress because there's so much detail data, especially in darker (low light) areas.

  • Have PS Element 12 using it with new MacBook pro.  When I edit and save a photo in jpeg format, and try to e-mail it, it has a duplicate but ghost image underneath, and I don't want this second image.  How do I get rid of it?

    Unwanted ghost image underneath edited file.  Need to solve!!!  Have not experienced this with my old CS2.  Please help.

    Hi Panamark,
    The problem has been resolved for me. I am a little fuzzy on how it got fixed.
    I only have 3G, so I think I went to the library to use wi-fi.
    I think I just deleted the stuck apps, and the downloaded them again. You do not have to pay again when you download a previously purchased app.
    It is now August, and fortunately I have not had any stuck apps lately.
    As you may already know, you cannot download an app over 20 MB via 3G.
    I have the Kindle app also. No new updates lately. I only bought one thing using Kindle. It was a guide to iPad that was only $1.99 or so, but it did not really have anything that cannot be found in normal free Apple guide.
    I have borrowed an ebook from the library using Overdrive app. You can choose the ebook version from Kindle.
    I don't have any weather apps.
    Let me know what happened when you get the chance.
    M

  • How do i save image as a Jpeg?

    I cant work out how to save my image so i can print it!!

    There are two ways. File>save as  or File>Save For Web.
    Either option will save as a jpeg. In the save as dialog box look toward the bottom for a file type box. Click it and you can choose from a variety of file formats there including jpg. If you see a bunch of formats but jpg is not listed, then odds are your in the wrong mode. Jpg is only supported in 8 bits per channel. Goto Image>Mode then choose 8bits/channel.
    As for save for web - In the upper righthand corner of that dialog box you can choose a preset or select the drop down box for the file format.

  • Can't save images as jpg, jpeg, bmp, etc. only as Preview Document or All Files.

    I'm running Firefox 27.0 on OSX 10.9. When I try to save an image from a website I'm only given the option to save the file as a Preview Document or All Files. I cannot save the image as it exists on the website (ie. jpg, jpeg, gif.) Right now I'm saving as a Preview Document, opening that in preview and then exporting the file as an image. I'd like to just save the file directly from a website as an image rather than a Preview Document. How do I do this?

    Can't you give the file the correct file extension for that image (e.g. .jpg) when you save the file?
    Try to rename (or delete) the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
    *http://kb.mozillazine.org/mimeTypes.rdf
    *http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions

  • How to save in GIF or JPEG format?

    I make a drawing using Graphics objects and now i want to save it to a GIF or JPEG or BMP file.
    How to go about it?
    TIA
    Naveen

    Hi,
    Here is some code that may help.
    NOTES: pixels were recieved from a PixelGrabber proccess.
    transColor was picked from an image (you can supply your own code its just an int).
    blnTrans is a boolean flag indicating that a transparaent color was picked.
    dim is the dimensions of the image (any image will do).
    import javax.swing.*;
    import javax.media.jai.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import com.sun.image.codec.jpeg.*;
    import com.sun.media.jai.codec.ImageCodec;
    import com.sun.media.jai.codec.ImageEncoder;
    import com.sun.media.jai.codec.PNGEncodeParam;
    import com.sun.media.jai.codec.BMPEncodeParam;
    import com.sun.media.jai.codec.TIFFEncodeParam;
    import java.awt.image.*;
    import java.awt.color.*;
    import Acme.JPM.Encoders.*;
    //Some more Code
    int fileType = 0;
    File file = null;
    if (pixels != null)
    //create a file save dialog.
    //create a File Chooser.
    fc = new JFileChooser(););
    int returnValue = fc.showSaveDialog(this);
    //detemine the choose.
    if (returnValue == JFileChooser.APPROVE_OPTION)
    file = fc.getSelectedFile();
    //get the file ext and translate for switch.
    Utils ut = new Utils();
    String ext = ut.getExtension(file);
    if (ext.equals("gif"))
    fileType = 0;
    else if (ext.equals("jpg"))
    fileType = 1;
    else if (ext.equals("png"))
    fileType = 2;
    else if (ext.equals("tif"))
    fileType = 3;
    else if (ext.equals("bmp"))
    fileType = 4;
    switch (fileType)
    case 0:
    if (blnTrans)
    NewImageProducer img = new NewImageProducer(pixels, TransColor, dim);
    try
    FileOutputStream fos1 = new FileOutputStream(file);
    Acme.JPM.Encoders.ImageEncoder e = new GifEncoder(img, fos1);
    e.encode();
    fos1.close();
    catch (java.io.IOException e) {}
    else
    BufferedImage imb = new BufferedImage((int)dim.getWidth(), (int)dim.getHeight(), BufferedImage.TYPE_INT_RGB);
    imb.setRGB(0, 0, (int)dim.getWidth(), (int)dim.getHeight(), pixels, 0, (int)dim.getWidth());
    try
    FileOutputStream fos2 = new FileOutputStream(file);
    Acme.JPM.Encoders.ImageEncoder e = new GifEncoder(imb, fos2);
    e.encode();
    fos2.close();
    catch (java.io.IOException e) {}
    catch (Exception er) {}
    break;
    case 1:
    try
    BufferedImage bimg = new java.awt.image.BufferedImage((int)dim.getWidth(), (int)dim.getHeight(), BufferedImage.TYPE_INT_RGB);
    bimg.setRGB(0, 0, (int)dim.getWidth(), (int)dim.getHeight(), pixels, 0, (int)dim.getWidth());
    //Encode as a JPEG
    FileOutputStream fos3 = new FileOutputStream(file);
    JPEGImageEncoder jpeg = JPEGCodec.createJPEGEncoder(fos3);
    jpeg.encode(bimg);
    fos3.close();
    catch (java.io.IOException e) {}
    break;
    case 2:
    try
    BufferedImage bimg = new java.awt.image.BufferedImage((int)dim.getWidth(), (int)dim.getHeight(), BufferedImage.TYPE_INT_RGB);
    bimg.setRGB(0, 0, (int)dim.getWidth(), (int)dim.getHeight(), pixels, 0, (int)dim.getWidth());
    //Encode as a PNG
    FileOutputStream fos3 = new FileOutputStream(file);
    PNGEncodeParam pp = PNGEncodeParam.getDefaultEncodeParam(bimg);
    ImageEncoder png = ImageCodec.createImageEncoder("PNG", fos3, pp);
    png.encode(bimg);
    fos3.close();
    catch (java.io.IOException e) {}
    break;
    case 3:
    try
    BufferedImage bimg = new java.awt.image.BufferedImage((int)dim.getWidth(), (int)dim.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
    bimg.setRGB(0, 0, (int)dim.getWidth(), (int)dim.getHeight(), pixels, 0, (int)dim.getWidth());
    //Encode as a TIF
    FileOutputStream fos3 = new FileOutputStream(file);
    TIFFEncodeParam tp = new TIFFEncodeParam();
    ImageEncoder tif = ImageCodec.createImageEncoder("TIFF", fos3, tp);
    tif.encode(bimg);
    fos3.close();
    catch (java.io.IOException e) {}
    break;
    case 4:
    try
    BufferedImage bimg = new java.awt.image.BufferedImage((int)dim.getWidth(), (int)dim.getHeight(), BufferedImage.TYPE_3BYTE_BGR);
    bimg.setRGB(0, 0, (int)dim.getWidth(), (int)dim.getHeight(), pixels, 0, (int)dim.getWidth());
    //Encode as a BMP
    FileOutputStream fos3 = new FileOutputStream(file);
    BMPEncodeParam bp = new BMPEncodeParam();
    ImageEncoder png = ImageCodec.createImageEncoder("BMP", fos3, bp);
    png.encode(bimg);
    fos3.close();
    catch (java.io.IOException e) {}
    break;
    } //end of switch.
    } //end of file option.
    //Here is NewImageProducer
    import java.awt.image.*;
    import java.util.*;
    import java.awt.*;
    import java.applet.*;
    import java.awt.color.*;
    class NewImageProducer implements ImageProducer{
    private Vector vector = null;
    int[] pixels;
    int alpha;
    Dimension dim;
    public NewImageProducer(int[] pixels, int alpha, Dimension dim){
    vector = new Vector();
    this.pixels = pixels;
    this.alpha = alpha;
    this.dim = dim;
    public void addConsumer(ImageConsumer ic){
    if (isConsumer(ic) == false)
    vector.addElement(ic);
    public void removeConsumer(ImageConsumer ic){
    if (isConsumer(ic) == true)
    vector.removeElement(ic);
    public boolean isConsumer(ImageConsumer ic){
    return vector.indexOf(ic) > -1;
    public void startProduction(ImageConsumer ic){
    addConsumer(ic);
    int x = (int)dim.getWidth();
    int y = (int)dim.getHeight();
    Hashtable ht = new Hashtable();
    byte[] r = new byte[pixels.length];
    byte[] g = new byte[pixels.length];
    byte[] b = new byte[pixels.length];
    byte[] a = new byte[pixels.length];
    for (int i=0; i<pixels.length; i++)
    if (pixels[i] == alpha)
    a[i] = (byte)0;
    else
    a[i] = (byte)255;
    for (int i=0; i<pixels.length; i++)
    r[i] = (byte)((pixels[i] & 0xFF0000) >> 16);
    g[i] = (byte)((pixels[i] & 0x00FF00) >> 8);
    b[i] = (byte)(pixels[i] & 0x0000FF);
    ColorModel cm=null;
    try{
    cm = new IndexColorModel(8, pixels.length, r, g, b, a);
    catch (Exception e){e.printStackTrace();}
    Vector v = (Vector)vector.clone();
    Enumeration e = v.elements();
    while (e.hasMoreElements()){
    ic = (ImageConsumer)e.nextElement();
    ic.setColorModel(cm);
    ic.setDimensions(x, y);
    ic.setProperties(ht);
    ic.setHints(ImageConsumer.RANDOMPIXELORDER);
    int[] p = new int[pixels.length];
    for (int i=0; i<pixels.length; i++)
    p[i] = i;
    ic.setPixels(0, 0, x, y, cm, p, 0, x);
    ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
    public void requestTopDownLeftRightResend(
    ImageConsumer ic){;
    //Here is Utils
    import java.io.File;
    public class Utils {
    public final static String jpeg = "jpeg";
    public final static String jpg = "jpg";
    public final static String gif = "gif";
    public final static String tiff = "tiff";
    public final static String tif = "tif";
    public final static String png = "png";
    public final static String bmp = "bmp";
    * Get the extension of a file.
    public static String getExtension(File f) {
    String ext = null;
    String s = f.getName();
    int i = s.lastIndexOf('.');
    if (i > 0 && i < s.length() - 1) {
    ext = s.substring(i+1).toLowerCase();
    return ext;
    Get the Acme class at:
    http://www.acme.com/java/software/Package-Acme.JPM.html

  • How to save my project to JPEG format or any picture format?

    Hi
    I just finish all my edit and possible to convert to JPEG or any picture format? Because i used Illustrator to edit my picture.

    File --> Export.
    Mylenium

  • How do you save images as a jpeg level 10 in pse8?

    I am wanting to be able to submit images to a printing company that requires the images be sent as " sized at 8x10 at 300 ppi in any embedded color space and saved as a baseline standard, level 10 jpeg.  Any b and w images also should be in rgb not grayscale."  Can anyone tell me how to do this correctly????  Thank you!

    I am wanting to be able to submit images to a printing company that requires the images be sent as " sized at 8x10 at 300 ppi in any embedded color space and saved as a baseline standard, level 10 jpeg.  Any b and w images also should be in rgb not grayscale."  Can anyone tell me how to do this correctly????  Thank you!

  • PSE 8 - Don't get the option to SAVE AS to JPEG format

    When I open my raw files and make changes, and then try to SAVE AS to the JPEG format, I don't even get the option.  I only get a few options.  PSD, TIFF, PNG.  Any help would be appreciated.

    You've probably opened the file in the full Editor as 16-bit rather than 8-bit; JPEGs can only save in 8-bit.  Two ways to open it in the full Editor as 8-bit:
    - In the ACR editor, set Depth to 8-bit before opening the image in the full Editor.
    - In the full Editor, do Image > Mode > 8 Bits.

  • Is there a practical size limit on JPEG format image files?

    I have noticed when working with Photoshop v7.0 on Windows XP that, when creating a JPEG format image file from a very large scanned image (more than 800 Mb, maybe), the .jpg file will usually be saved on disk at any of the possible compression ratios available, without any reported error, yet when the saved file is re-opened, an error is reported - something along the lines of "missing or corrupted end of file marker" - and the image cannot be loaded.
    If before saving the original image is substantially reduced in size, e.g. by reducing the resolution of the image, a viable JPEG format file can be created, which will subsequently load successfully, though technically with data loss.
    This appears to happen only with JPEG format files - PDF format files can be saved from the original image at similar JPEG compression ratios, without error on reloading.
    I do not know if this also occurs with any other Photoshop versions.  I am working with Adobe Photoshop v7.0 on Windows XP, although we are preparing to upgrade to CS (which version I don't know) in the near future, for different reasons to those which are detailed above.
    Does anyone know if there is a technical explanation for this behaviour?  Is there a file size limit for writing viable JPEG files (which Photoshop does not report as an error when exceeded)?
    Thanks

    Chris Cox wrote:
    Where did you get the idea that we weren't doing something about it?
    that's what I gathered from "JPEG cannot [...] in Photoshop (code difficult to replace)".
    But if you say this is in the works right now, that's good news indeed.
    Chris Cox wrote:
    And where did you get the idea that posts get deleted? (other than SPAM)
    Are you sure you're reading the same forum as the rest of us?
    That's what happened:
    The content you posted below was reported for abuse and removed by our
    moderators:
    Subject: Re: Is there a practical size limit on JPEG format image files?
    Posted: 4/29/11 9:11 AM
    Anyway, you gave an honest answer on this technical issue, Chris, and that's what counts.

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

  • How can I save images as a bitmap instead of jpeg format?

    I would like to save images I find at web sites in bitmap format.
    However it seems only jpeg type format is the way firefox will let me save images. Is there a way to save images in bitmap format?

    Firefox will only save an image in the format that it is delivered in, it has no file type conversion capabilities.

  • I can't save my picture to .jpeg in CameraRaw, the only format available is .dng. Why??

    I want to save my pictures to .jpeg in CameraRaw, but the only format available is .dng. I have to open the picture in Elements 12 just to save as .jpeg. Why??

    Because the ACR module is meant to convert the raw data into an image format that the editor can read. From the editor (or the organizer) you can save your raw files to image files formats like jpeg, tiff or psd. Simply click the 'Open in editor' button.
    For batch conversion to jpeg, either use the 'process multiple files' option in the file menu of the editor, or select several raws in the organizer and export to a new location in the desired format.
    The option to 'save' as DNG may be used if you want to convert to the raw DNG format. You don't need to use that feature.
    I highly recommend you take the time to read the help file (Help button in the camera raw dialog).

  • 'Save As' to JPEG format (or to TIFF)

    The 'Save As' command produces 20 different file format options to choose from. When 'saving as' to the default PSD format, the selection is obviously quick and easy. However I mostly 'save as' to JPEG format or TIFF format and it is awkward to make the JPEG or TIFF format selections each time.
    After doing 'Save As', I have been clicking on 'Format' and then typing 'j' or 'ti' to bring up JPEG or TIFF from the menu of 20 formats to speed up the selection a little bit as compared to scrolling through the Format menu.
    But it would be much easier to have a script that could bring up a modified version of the "Save As" dialogue box so that 'Save As' to JPEG format or 'Save As' to TIFF format could be executed very efficiently and without having to wade through the clutter of the 17 other file formats in the Format menu which I hardly ever use.
    I have done a fair amount of web searching, including on ps-scripts.com, but so far without finding a good solution to this. Any help would be much appreciated.
    Of course I have thought of creating an Action (with assigned keyboard shortcut) which saves to JPEG and another Action which saves to TIFF. However, the saved file then always ends up in one location and with the same file name, therefore often requiring the additional steps of renaming and moving the file.
    Batch processing of Actions (perhaps in conjunction with the Image Processor script) is perfect for batches, especially for large batches but I was hoping for something quick and easy for saving files individually.
    Thanks!
    Geoff
    P.S. I also tried finding a way of disabling all the 'Save As' file formats which I never use so that the 'Save As' format choices would be very few (i.e. 3 or 4 instead of 20) but have had no success there.

    It's been awhile since I played with the saveAs function.
    Pretty sure you have to type the file name in the save dialog
    Here is a function I created for work.
    I removed a lot of code from it that doesn’t pertain to this topic but the code should work
    This might help you with a little more understanding and show how you can hard code where to save without even bringing up a dialog box
    saveAsPNG( filelocation + filename )// usage
    function saveAsPNG( where ){
                   var tmpFile = File(where + '.png' );
                   var pngOpts = new ExportOptionsSaveForWeb;
                        pngOpts.format = SaveDocumentType.PNG
                   //     pngOpts.PNG8 = true;
                        pngOpts.transparency = true;
                   //     pngOpts.interlaced = false;
                        pngOpts.quality = 100;
                   app.activeDocument.exportDocument(tmpFile,ExportType.SAVEFORWEB,pngOpts);
              return true;

Maybe you are looking for