Resize/Rescale JPEG suggestions?

Hello once again,
After reading a lot of posts it has become clear that J2ME does not have a built in method of resizing/rescaling images, inparticular jpeg images.
I found a piece of code that appeared to shrink jpegs by removing pixels from the image and creating a new image with these pixels but even on a 2.4ghz computer it still takes a good few seconds to complete (not to mention the memory it probably uses!).
Im posting to see if anyone knows any classes/packages i could use to practically resize an image (of about 1megapixel in size) on a mobile phone?
Basiclly, im trying to create a zoom function in a java midlet that can either show the user a thumbnailed image or a full size image that can be scrolled across...
Any suggestions?
Thanks,
Daniel

J2ME (and the devices it's used for) is really not designed for this kind of thing, because of the assumed lack of processing power available.
If you are getting the images from a remote site, you are better of making use of a web service (read the term loosely) to resize the image for you.

Similar Messages

  • Preview - saving resized CMYK JPEGs

    I can't save a resized CMYK JPEG with Preview:
    Take a JPEG, any JPEG.
    Duplicate it, make an RGB and a CMYK version (create whichever one did not already exist) using
    GraphicConverter or a similar tool.
    Open each in Preview and use "Adjust Size..." to adjust the resolution.
    Save. RGB version saves fine. CMYK version fails with "The document 'CMYK.jpg' could not be saved."
    Can anyone confirm or deny?

    Just been bitten by the same problem. It seems to work fine on Leopard but seems broken in SL?

  • Problems resizing certain jpegs in cs6

    When I resize certain jpegs in Photoshop and then save, the file size remains the same. It has definately been resized because it shows a new file size in PS.
    I've never encountered this before until a couple of weeks back. Has anyone had the same problem.

    See Replace Your Preferences and if that doesn't do it, see Adobe Forums: InDesign crashes at startup for a list of other things to delete from the original account.
    When all else fails, rename the Adobe folders in your user library (remmber, there are TWO folders, anf they're hidden, so see Access hidden user library files | Mac OS 10.7 Lion) and copy the ones from the guest account.

  • Resizing / rescaling resolution of photos for use in iWeb

    I am shooting with a 7.1 Mega Pixel Canon to get enough quality to crop and print high quality pictures of my baby daughter and her adventures in the world.
    I have a website up made with iWeb, but when I select the photos in iPhoto and go Share / Sent to iWeb / photo page - I get a nice layout of the photos but at full resolution when the thumbnails are selected or the slide show is run. Although nice and sharp, this is a pain for anyone looking at the site even with high speed access.
    There must be some way to resize photos, but I have yet to figure that out with iPhoto, let alone iWeb. And as one photo at a time is a pain, there must also be a way to rescale a whole selection of photos that I want to use for a page - say her Disneyworld trip. I can't be the first person to run into this, but I have not found anything out there to point me in the right direction.
    Ideally I wold like to create a resized set from the originals - so I can still print and crop in high qulity. I also am not really sure what resolution would be best or easy viewing and download - that's probably subjective. 1200x800 comes to mind but I am open to suggestions. Of course dreaming about that resolution is nice - but first I need to figure out how to do it and do it on a wide scale basis.
    Perhaps resize is not the right term - changing resolution is probably more accurate, but there too I have not found an answer.
    Appreciate the help and suggestions.

    oldhoss:
    You mean you've not found out how to resize images with Photoshop? It's all in the Image->Image Size menu. Enter the pixel dimensions in the boxes and go from there. Also PS has the capability of saving for web. I can reduce a 1600 x 1200 jpg file from 1.7MB to 212 KB by selecting the Medium quality level (5) in the Save As window. However, using PS's "Save for Web and Devices" menu option, medium jpg option, it is only 112 KB and the image quality is outstanding.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto 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 written an Automator workflow application (requires Tiger), 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. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    G5 Dual Core 2GHz, 2G RAM, 250G HD; G4 Dual 1Ghz, 1.5G RAM, 80G HD, QT 7.1.3,   Mac OS X (10.4.8)   22 LCD, 250G/200G/160G FW HDs, Canon: SD700IS/i850/LIDE 50, Epson R200, 30G iPod

  • Resizing Motion Jpeg video without applying any transcoding

    Hello,
    My apology if this is a silly question.
    I have Motion Jpeg video clip, which I need only to resize from 1920x1080 to 768x432.
    I want to leave codec, output fields and everything else as it is.
    What would be the best way to do this?
    Thank you so much for your advise.

    I would recommend doing the resize through compressor as it should intelligently scale the image. Although downscaling isn't as drastic as going up, it still can cause problems. If your compression settings are kept high you should notice any more compression with most codecs, but I can understand your concern with JPEGs.
    The other option is to convert to a codec such as animation which is uncompressed, down scaling within compressor. Then convert the animation back to a Motion JPEG. No quality will be lost.
    The final option is to use QuickTime 7. open the file as usual in QT7 (has to be 7), press Command + J to access Movie Properties. Select the video track and choose and enter the scale in the boxes below. This will resize the video, just hit Command + S to save the file. This alters the display size only and the file will retain its 1920x1080 size information, thus the overall file size will not change.
    Good luck.
    "A snowed in" James.

  • What is the best way to resize a JPEG and store it in the Filesystem

    Hi All,
    I have developped a CMS System that renders JPEGs if it does not have the images available within the desired width already. Within my development setup (Dell Latitude D800 with ubuntu dapper drake) everything works fine and fast, as expected. Then I uploaded the application to my V20Z Server with 4gb RAM and the systems performance goes to its knees. I have hooked in a Java Profiler to see where the problem is, and it showed me that it is hanging wthin
    sun.java2d.SunGraphics2D.drawImage(Image, int, int, ImageObserver) which I use to draw my Image to a BufferedImage. Below is my complete source code That I am using. Plus the orofiling results
    Do not be confused as I am using the Turbine Framework, which gives me a RawScreen which gives me Access to the HttpServletResponse...
    package de.ellumination.carmen.modules.screens;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.util.Iterator;
    import java.util.Locale;
    import javax.imageio.IIOImage;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageWriteParam;
    import javax.imageio.ImageWriter;
    import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
    import javax.imageio.stream.ImageOutputStream;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.log4j.Logger;
    import org.apache.turbine.modules.screens.RawScreen;
    import org.apache.turbine.util.RunData;
    import de.ellumination.carmen.om.ImagePeer;
    public class Image extends RawScreen
    public static final float DEFAULT_COMPRESSION_QUALITY = 1.0F;
    * Logger for this class
    private static final Logger log = Logger.getLogger(Image.class);
    @Override
    protected String getContentType(RunData data)
    return "image/jpeg";
    @Override
    protected void doOutput(RunData data) throws Exception
    int imageId = data.getParameters().getInt("id");
    int width = data.getParameters().getInt("width", -1);
    int height = data.getParameters().getInt("height", -1);
    HttpServletResponse response = data.getResponse();
    de.ellumination.carmen.om.Image image = ImagePeer.retrieveByPK(imageId);
    File imgFile = new File(image.getLocation());
    if(width > 0 || height > 0)
    outputScaledImage(imgFile, response, width, height);
    else
    outputImage(imgFile, response);
    private void outputScaledImage(File imageFile, HttpServletResponse response, int width, int height) throws Exception
    File scaledFile = new File(imageFile.getParent() + System.getProperty("file.separator") + width + "_" + imageFile.getName());
    if(scaledFile.exists())
    outputImage(scaledFile, response);
    else
    scaleImage(imageFile, scaledFile, width);
    outputImage(scaledFile, response);
    private void outputImage(File imageFile, HttpServletResponse response) throws Exception
    FileInputStream in = new FileInputStream(imageFile);
    response.setContentLength((int) imageFile.length());
    OutputStream out = response.getOutputStream();
    int bSize = 10240;
    byte[] buffer = new byte[bSize];
    int inBuffer = 0;
    while (inBuffer >= 0)
    inBuffer = in.read(buffer);
    if (inBuffer > 0)
    out.write(buffer, 0, inBuffer);
    * scales the image to its new size. while scaling the Image, the code first resizes the image using the new Width Parameter.
    * If the Image is to high after scaling, it then uses the Images height to determin the scaling Factor.
    * @param inputFile the original Image
    * @param outputFile the File to store the scaled image to
    * @param compressionQuality the compression Quality to use
    * @param newWidth the desired images width
    * @param newHeight the desired images height
    public static void scaleImage(File inputFile, File outputFile, float compressionQuality, int newWidth, int newHeight)
    try
    if (inputFile.exists())
    BufferedImage hiRes = ImageIO.read(inputFile);
    double scaleFactor = (double) newWidth / (double) hiRes.getWidth(null);
    int tempHeight = (int) (hiRes.getHeight(null) * scaleFactor);
    if (tempHeight > newHeight)
    scaleFactor = (double) newHeight / (double) hiRes.getHeight(null);
    int width = (int) (hiRes.getWidth(null) * scaleFactor);
    int height = (int) (hiRes.getHeight(null) * scaleFactor);
    scaleImage(outputFile, compressionQuality, hiRes, width, height);
    catch (IOException e)
    log.error("Unable to create the thumbnail " + outputFile.getAbsolutePath() + " from " + inputFile.getAbsolutePath() + " because of the following Reason.", e);
    * scales the image to its new size. while scaling the Image, the code first resizes the image using the new Width Parameter.
    * If the Image is to high after scaling, it then uses the Images height to determine the scaling Factor. This method uses the
    * default compression quality to store image data.
    * @param inputFile the original Image
    * @param outputFile the File to store the scaled image to
    * @param newWidth the desired images width
    * @param newHeight the desired images height
    public static void scaleImage(File inputFile, File outputFile, int newWidth, int newHeight)
    scaleImage(inputFile, outputFile, DEFAULT_COMPRESSION_QUALITY, newWidth, newHeight);
    * scales the image to its new size. while scaling the Image, the code first resizes the image using the new Width Parameter.
    * uses the highest image compression quality by default.
    * @param inputFile the original Image
    * @param outputFile the File to store the scaled image to
    * @param compressionQuality the compression Quality of the new Image
    * @param newWidth the desired images width
    public static void scaleImage(File inputFile, File outputFile, float compressionQuality, int newWidth)
    try
    if (inputFile.exists())
    BufferedImage hiRes = ImageIO.read(inputFile);
    double scaleFactor = (double) newWidth / (double) hiRes.getWidth(null);
    int width = (int) (hiRes.getWidth(null) * scaleFactor);
    int height = (int) (hiRes.getHeight(null) * scaleFactor);
    // draw original image to thumbnail image object and
    // scale it to the new size on-the-fly
    scaleImage(outputFile, compressionQuality, hiRes, width, height);
    else
    log.error("Unable to create the thumbnail " + outputFile.getAbsolutePath() + " from " + inputFile.getAbsolutePath() + " because inputFile not exists: " + inputFile.getName());
    catch (IOException e)
    log.error("Unable to create the thumbnail " + outputFile.getAbsolutePath() + " from " + inputFile.getAbsolutePath() + " because of the following Reason.", e);
    * scales the image to its new size. while scaling the Image, the code first resizes the image using the new Width Parameter.
    * uses the highest image compression quality by default.
    * @param inputFile the original Image
    * @param outputFile the File to store the scaled image to
    * @param newWidth the desired images width
    public static void scaleImage(File inputFile, File outputFile, int newWidth)
    scaleImage(inputFile, outputFile, DEFAULT_COMPRESSION_QUALITY, newWidth);
    * This private method actually scales the inputImage to the desired height, width and compression Quality
    * @param outputFile The File in which the Image should be stored.
    * @param compressionQuality The Compression Quality to be applied to the image
    * @param inputImage the original input Image
    * @param width the height of the new Image
    * @param height the width of the new Image
    * @throws IOException
    private static void scaleImage(File outputFile, float compressionQuality, BufferedImage inputImage, int width, int height) throws IOException
    BufferedImage lowRes = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    java.awt.Image image = inputImage.getScaledInstance(width, height, java.awt.Image.SCALE_SMOOTH);
    ImageWriter writer = null;
    Iterator iter = ImageIO.getImageWritersByFormatName("jpg");
    if (iter.hasNext()) writer = (ImageWriter) iter.next();
    File outputPath = outputFile.getParentFile();
    if (outputPath != null)
    if (!outputPath.exists()) outputPath.mkdirs();
    lowRes.getGraphics().drawImage(image, 0, 0, null);
    ImageOutputStream ios = ImageIO.createImageOutputStream(outputFile);
    writer.setOutput(ios);
    ImageWriteParam iwparam = new JPEGImageWriteParam(Locale.getDefault());
    iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
    iwparam.setCompressionQuality(compressionQuality);
    // save thumbnail image to OUTFILE
    writer.write(null, new IIOImage(lowRes, null, null), iwparam);
    writer.dispose();
    ios.close();
    image.flush();
    inputImage.flush();
    lowRes.flush();
    * scales the image to its new size. while scaling the Image, the code first resizes the image using the new Width Parameter.
    * If the Image is to high after scaling, it then uses the Images height to determin the scaling Factor.
    * @param inputImage the original Image
    * @param outputFile the File to store the scaled image to
    * @param compressionQuality the compression Quality to use
    * @param newWidth the desired images width
    * @param newHeight the desired images height
    public static void scaleImage(BufferedImage inputImage, File outputFile, float compressionQuality, int newWidth, int newHeight)
    try
    double scaleFactor = (double) newWidth / (double) inputImage.getWidth(null);
    int tempHeight = (int) (inputImage.getHeight(null) * scaleFactor);
    if (tempHeight > newHeight)
    scaleFactor = (double) newHeight / (double) inputImage.getHeight(null);
    int width = (int) (inputImage.getWidth(null) * scaleFactor);
    int height = (int) (inputImage.getHeight(null) * scaleFactor);
    scaleImage(outputFile, compressionQuality, inputImage, width, height);
    catch (IOException e)
    log.error("Unable to create the thumbnail " + outputFile.getAbsolutePath() + " because of the following Reason.", e);
    All Threads     702.570     100 %
    java.lang.Thread.run()     551.322     78 %
    de.ellumination.carmen.modules.screens.Image.doOutput(RunData)     170.666     24 %
    de.ellumination.carmen.modules.screens.Image.outputScaledImage(File, HttpServletResponse, int, int)     170.108     24 %
                             de.ellumination.carmen.modules.screens.Image.scaleImage(File, File, int)     170.108     24 %
                                  de.ellumination.carmen.modules.screens.Image.scaleImage(File, File, float, int)     170.108     24 %
                                       de.ellumination.carmen.modules.screens.Image.scaleImage(File, float, BufferedImage, int, int)     165.787     24 %
                                            sun.java2d.SunGraphics2D.drawImage(Image, int, int, ImageObserver)     165.189     24 %
                                            com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(IIOMetadata, IIOImage, ImageWriteParam)     397     0 %
                                            javax.imageio.ImageIO$ImageWriterIterator.next()     69     0 %
                                            javax.imageio.ImageIO.createImageOutputStream(Object)     47     0 %
                                            java.awt.image.BufferedImage.<init>(int, int, int)     36     0 %
                                            java.awt.Image.getScaledInstance(int, int, int)     23     0 %
                                            java.awt.image.BufferedImage.getGraphics()     21     0 %
                                       javax.imageio.ImageIO.read(File)     4.320     1 %
                        de.ellumination.carmen.om.BaseImagePeer.retrieveByPK(int)     557     0 %
                   de.ellumination.carmen.modules.screens.Index.doBuildTemplate(RunData, Context)     1.673     0 %
              org.apache.catalina.startup.Bootstrap.main(String[])     151.225     22 %
              org.quartz.core.QuartzSchedulerThread.run()     22     0 %
    Now I am looking for the Best way to solve my problem. Maybe I am wrong from the get go.
    Runtime Setup Java 1.5.0_04 Tomcat 5.5.12 V20z (AMD64 Opteron 4gb RAM)
    Any help is heighly appreciated
    Kind regards

    This is a bad thing to do with JPEGs. You're better off just reducing the 'q' if you want a smaller/faster/lower resolution image. That way you're throwing away resolution intelligently. Using scaling you're throwing resolution away unintelligently. I was on a project where 40,000 images were scaled when they should have been low-q'd. Don't do it.

  • Preview fails to resize Photoshop JPEGs

    I have a 2013 Retina MBP on Yosemite, with a licensed copy of Photoshop CC. My problem is, Preview cannot deal with JPEGs I am creating in Photoshop. Preview is really sluggish when it loads the images, and is unable to resize them. It appears to do so, but when the image is saved and closed, the resolution is not modified correctly and the file size stays oddly large.
    Here is one such image: https://drive.google.com/file/d/0B1-phaWAfkzjQUxMR3EydDJLM1k/view?usp=sharing
    Something about these JPEGs is making Preview lose its mind, but I'm not sure what it is. Can anyone help?

    Post a link to one, please.
    Which DW? Which OS?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Nathan McKinney" <[email protected]> wrote
    in message
    news:gorfbi$1ls$[email protected]..
    >
    Ok, I have a dreamweaver question, and I?m hoping you
    can help
    > me
    > solve the trouble.
    >
    > I am creating some images using photoshop. Building a
    site locally and
    > trying
    > to see the images in dreamweaver.
    >
    > They are standard RGB images, jpgs. When I pull them
    directly into
    > browsers,
    > they all work great. For some crazy reason I can?t get
    them to preview in
    > dreamweaver. They show up as broken links.
    >
    > I have covered a few trouble shooting basics here, and
    still haven?t
    > figured
    > it out.
    >
    > 1) the images are definitely RGB, and work in normal web
    browsers, just
    > not in
    > dreamweaver.
    > 2) In fact, when I preview the html in a browser via
    dreamweaver the links
    > seem to work. They are only broken in dreamweaver
    itself.
    > 3) I have pulled random jpegs off of the web, dropped
    them into that same
    > folder linked them up the same way and they work fine.
    Only the jpegs I'm
    > creating in photoshop seem to be causing the trouble.
    > 4) I have tried various options in the site management
    dialog box
    > including
    > making links relative to the document or the site root.
    Nothing changes.
    > 5) I have exported the jpegs a number of different ways
    from photoshop,
    > via
    > the normal ?save? and also ?save for web?
    > 6) When I save the jpegs as a gif instead, they work
    fine.
    > 7) I have reset the root site several times, and
    rebooted several times.
    > No
    > dice.
    >

  • How to resize Image Jpeg ?

    I have a problem when I scale file image Jjpeg.
    My code :
    public void resize(Image img){
    BufferredImage bimg = toBufferedImage(img);
    AffineTransform tx = new AffineTransform();
    tx.scale(125,125);
    AffineTransformOp op = new AffineTransformOp (tx,AffineTransformOp.TYPE_BILINEAR)
    bimg = op.filter(bimg, null);
    public static BufferedImage toBufferedImage(Image image) {
    if (image instanceof BufferedImage) {
    return (BufferedImage)image;
    // Determine if the image has transparent pixels; for this method's
    // implementation, see e661 Determining If an Image Has Transparent Pixels
    boolean hasAlpha = hasAlpha(image);
    // Create a buffered image with a format that's compatible with the screen
    BufferedImage bimage = null;
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    try {
    // Determine the type of transparency of the new buffered image
    int transparency = Transparency.OPAQUE;
    if (hasAlpha) {
    transparency = Transparency.BITMASK;
    // Create the buffered image
    GraphicsDevice gs = ge.getDefaultScreenDevice();
    GraphicsConfiguration gc = gs.getDefaultConfiguration();
    bimage = gc.createCompatibleImage(
    image.getWidth(null), image.getHeight(null), transparency);
    } catch (HeadlessException e) {
    // The system does not have a screen
    if (bimage == null) {
    // Create a buffered image using the default color model
    int type = BufferedImage.TYPE_INT_RGB;
    if (hasAlpha) {
    type = BufferedImage.TYPE_INT_ARGB;
    bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
    // Copy image to buffered image
    Graphics g = bimage.createGraphics();
    // Paint the image onto the buffered image
    g.drawImage(image, 0, 0, null);
    g.dispose();
    return bimage;
    }

    This is my code :
    private ImageIcon getImageIcon(String path){
    ImageIcon iIcon = new ImageIcon(path);
    if(iIcon.getIconHeight() > 125 || iIcon.getIconWidth() > 125){
    Image img = iIcon.getImage();
    int iw = img.getHeight(null);
    int ih = img.getWidth(null);
    BufferedImage bImage1 = toBufferedImage(img);
    BufferedImage bImage2 = new BufferedImage(400,400,1);
    AffineTransform tx = new AffineTransform();
    tx.scale(400,400);
    AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
    BufferedImage bImage3 = op.filter(bImage1, bImage2);
    img = Toolkit.getDefaultToolkit().createImage(bImage2.getSource());
    return (new ImageIcon(img));
    if(iIcon == null)
    return null;
    return iIcon;
    public static BufferedImage toBufferedImage(Image image) {
    if (image instanceof BufferedImage) {
    return (BufferedImage)image;
    // Determine if the image has transparent pixels; for this method's
    // implementation, see e661 Determining If an Image Has Transparent Pixels
    boolean hasAlpha = hasAlpha(image);
    // Create a buffered image with a format that's compatible with the screen
    BufferedImage bimage = null;
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    try {
    // Determine the type of transparency of the new buffered image
    int transparency = Transparency.OPAQUE;
    if (hasAlpha) {
    transparency = Transparency.BITMASK;
    // Create the buffered image
    GraphicsDevice gs = ge.getDefaultScreenDevice();
    GraphicsConfiguration gc = gs.getDefaultConfiguration();
    bimage = gc.createCompatibleImage(
    image.getWidth(null), image.getHeight(null), transparency);
    } catch (HeadlessException e) {
    // The system does not have a screen
    if (bimage == null) {
    // Create a buffered image using the default color model
    int type = BufferedImage.TYPE_INT_RGB;
    if (hasAlpha) {
    type = BufferedImage.TYPE_INT_ARGB;
    bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
    // Copy image to buffered image
    Graphics g = bimage.createGraphics();
    // Paint the image onto the buffered image
    g.drawImage(image, 0, 0, null);
    g.dispose();
    return bimage;
    When I recieve Img3 which is not same original Image (img1)
    Please help me ?

  • Resizing a jpeg

    I have a class that uses robot.createScreenCapture to capture an image created on a JPanel. The image is saved with dimensions width 792 hieght 492.
    When I recall the image I want it to be displayed at 800,600.
    Is there a way to do this with? And if so how?
    Thanks
    Jim

    Could you eloaborate a little on how to use this class. First time I've messed with it, and I'm a little lost.
    Thanks
    Jim

  • Resize jpeg picture file.

    Hi
    How do i resize a jpeg picture (*.jpg) and save it in labview.?
    eg. from 800x600 to 640x480.
    thanks
    Per

    If you can get by with decimation, the answer is simple.
    Anthony de Vries on 8/16/2001 answered this question.
    He basically unflattened the flattened image out of the "Read JPEG" and then removed rows and columns from the pixmap matrix to shrink the image. If your JPEG must be arbitrarily scaled (i.e. can't be a 1:2, 1:3, 1:4, etc. decimation), you will have to do as IreneHe suggested and interpolate the values to match "fractional indices" of the new array. You should be able to use the array functions to do this.
    After you decimate your pixmap matrix, send it through the flatten function and draw the flattened pixmap to your picture indicator.
    I'm sorry I don't have exact function names. I am away from my LabVIEW machine at the moment.
    jc
    Mac 10.4
    LV7.1
    CLD

  • Better to resize JPEGs for a QT sequence before or while exporting from QT?

    I have several thousand JPEG files shot as a time-lapse sequence, at my DSLR camera's smallest size of 4288 by 2848 pixels. I want to sequence them as a QuickTime movie, for a final frame size of 1920 by 1080 pixels. Is it okay to batch resize the JPEGs in a photo application (PhotoMechanic or Photoshop) before creating the Quick Time Pro sequence and then exporting it as a .MOV, or am I better off sequencing the JPEGs in QuickTime Pro, then exporting them as a 1920 by 1080 pixel movie file?
    The last time I did this I let QTPro do the resizing while exporting, and it took over an hour to generate the .MOV file. Is that to be expected given the "fast" computer I'm using?

    Resize the image files prior to import to QuickTime.
    It'll be faster on your machine.

  • Jpegs can't be resized after exporting from InDesign

    I am using Indesign CC9.2.  A problem has recently developed where I cant resize a jpeg.  It doesnt matter file size or settings.  I have tried every combination.  I export a simple document to jpeg and save to my desktop.  I open the file in Preview.  I resize it, and an error message states "this change cannot be saved".
    This only happens with Jpegs I have exported from Indesign. No problems with jpegs from any other source.  Any ideas?

    Rob Day schrieb:
    Yo can resize and resample
    But only with RGB images you are able to save the resized file, not with CMYK.
    But the same problem comes with most of free image editors, they don't suppoert CMYK.
    Maybe that Kristine should export as RGB, then she will be able to scale it or scale it upon JPG export from InDesign.

  • How to get jpegs automatically resized when placed in a book?

    Hello all,
    New member on board here. Got a question for you guys.
    When I pull a jpeg into a book page (I'm using the Library theme), I'm getting a "!" in a yellow triangle. I'm assuming that means the jpeg is too big.
    Is there a way that iPhoto can automatically resize a jpeg to fit within the parameters of the picture space?

    Thinkingman:
    Welcome to the Apple Discussions. Just the opposite, it means that the pixel dimensions of the photo are deemed too small for optimum image quality by iPhoto. What pixel dimensions are the photos and what size frame are you using it in?
    iPhoto automatically resizes photos to fit the frames in books, and the containers in the other items, calendars, cards, etc.
    Do you Twango?

  • Anyone use JAI  yet? How do I resize JPEG?

    How do I resize a jpeg that someone has uploaded via a form before I save it to the server? It would already be in an input stream of some sort already.
    Thanks,
    Spack

    I just started reading the JAI docs, but I can think of at least one way to do it with JDK 1.3 code. I would start by creating an ImageIcon from your stream or creating an Image from the stream and feed it into an ImageIcon object. Not sure of exact code to accomplish converting a stream to an Image, although ImageIcon objects can be constructed with a byte array of image data. I understand that creating the ImageIcon will block until the Image is fully loaded, useful in preventing NullPointerExceptions that occur when you try to manipulate an incompletely loaded Image object. From there, try feeding the ImageIcon object and resizing height and width parameters to the following method.
    import javax.swing.*;
    import java.io.*;
    import java.awt.image.*;
    ImageIcon myImageIcon = new ImageIcon(
    bytesFromInputStream );
    myImageIcon = resizeImage( myImageIcon, maxWidth,
    maxHeight);
    // The width and height constraints are meant to indicate
    // maximum sizes for the resulting image in either aspect.
    // This method should retain the original aspect ratio of
    // the image; and its largest aspect will be held to the
    // appropriate provided aspect constraint (if the image
    // is wider than it is tall, it will still be wider than it is tall
    // when resized, only its width will be equal to the
    // widthConstraint value.
    private ImageIcon resizeImage( ImageIcon fromStream,
    int widthConstraint, int heightConstraint)
      int imgWidth = fromStream.getIconWidth();
      int imgHeight = fromStream.getIconHeight();
      ImageIcon adjustedImg;
      if ( imgWidth > widthConstraint | imgHeight >
       heightConstraint )
        if ( imgWidth > imgHeight )
          // Create a resizing ratio.
          double ratio = (double) imgWidth / (double)
           widthConstraint;
          int newHeight = (int) ( (double) imgHeight / ratio );
          // use Image.getScaledInstance( w, h,
          // constant), where constant is a constant
          // pulled from the Image class indicating how
          // process the image; smooth image, fast
          // processing, etc.
          adjustedImg = new ImageIcon(
           fromStream.getImage().getScaledInstance(
            widthConstraint, newHeight,
            Image.SCALE_SMOOTH )
        else
          // Create a resizing ratio.
          double ratio = (double) imgHeight / (double)
           heightConstraint;
          int newWidth = (int) ( (double) imgWidth / ratio );
          adjustedImg = new ImageIcon(
           image1.getImage().getScaledInstance( newWidth,
            heightConstraint, Image.SCALE_SMOOTH )
        // return the adjusted ImageIcon object.
        return adjustedImg;
      else
        // Assure the resources from the adjustedImg object
        // are released and then return the original ImageIcon
        // object if the submitted image's width and height
        // already fell within the given constraints.
        adjustedImg = null;
        return fromStream;   
    }From there, you can extract the Image object from myIconImage via myIconImage.getImage() and use that with whichever codec supports Image object conversion. I am pretty sure that the com.sun.image.codec.jpeg.JPEGCodec will do so (or somthing in that package can). Certainly JAI will have something from there.
    Good luck,
    Ryan

  • Loss transparency in an animated GIF image when resizing

    Hi Friends,
    I have to write a program to resize GIF, JPEG , and PNG images. I wrote and it works but when i resize a GIF file it loses its transparency and give a black color for transparent area.
    I used a GifDecoder found at www.fmsware.com/stuff/GifDecoder.java
    and a gif encoder found at jmge.net/java/gifenc/Gif89a090b.zip.
    i don't know where the problem is .
    i have some small problems in here.
    How can i preserve the transparency of GIF image?
    How can i set a transparent color in Graphic2D object? smtimes it may help me. or error may be in the encoder.
    Help me guys.
    Thanks and regards,
    Manjula

    Java comes with gif encoder/decoders.
    Gifs are indexed images. This means that, for example, each pixel is an 8 bit value that is used to look up the correct 24 bit value in the index table. Gifs handle transparency by allowing one particular pixel value to be nominated as transparent.
    If you just rescale the image then you will likely cause pixels with the magic "transparent" value to change their value and become normal pixels. Alternately pixels that are not transparent may have their values changed such that they are transparent.
    Possibly the easyist solution to to force the image into a full RGBA image. Scale this then perform post processing on the image. I.e convert it back into an indexed image, looking at the values of the alpha channel (prior to making it indexed and if they are high enough then modify the corresponding pixel in the indexed image to have the magic transparent value. Then use Metadata passed to your Image writer to indicate which value is transparent.
    matfud

Maybe you are looking for