Resize jpeg fast

Hi Guys
I have the following code that I use to get a picture in the format of a byteArray[] into an ImageObject, in order to be able to resize the picture into a thumbnail.
Image inImage = new ImageIcon(pictureAsByteArray).getImage();
The problem is that the creation of the Image object takes way too long!! Is there a better way to do this?
Thanks
David

Well, I dont know what types of images you plan on using, but I was working with XWD (X-windows dump) images. The XWDs are filled up with header information first and then the pixel bytes come next (I would assume it's the same setup with every other type of image). So, I retrieved the image width and height information from the header. Then, I have my own size constants THUMBNAIL_WIDTH and THUMBNAIL_HEIGHT that I want the thumbnails to be. I make some other variables like the reduced ratio of the image, the pixel array of my resulting image, and the number of pixels I create per every row.
int RATIO = header.windowHeight/THUMBNAIL_HEIGHT;
int[] pixels = new int[(header.pixmapWidth/RATIO) * (header.pixmapHeight/RATIO)];
int valsPerRow = header.pixmapWidth/RATIO;// # of used pixels per row
int count = 0, rowCount = 0;Then it's only a matter of a simple loop.
for (int pixelCount = 0; pixelCount < pixels.length; pixelCount++) {
                pixels[pixelCount] = 0;
                rowCount = pixelCount/valsPerRow;
                if (pixelCount%valsPerRow == 0)
                    count = RATIO * rowCount * header.bytesPerLine;
                // do some stuff to obtain RGB values from the bytes
                pixels[pixelCount]= //add up RGB to make single pixel 
                count = count + RATIO*bytesPerPixel; 
            }// for   The hardest part was obtaining the proper RGB values from the bytes (had to worry about Big Endian/Little Endian byte order and all these Unix boxes creating their screen dumps in a different way).
By the way, does anyone know of a good algorithm for reading all types of X-windows dump images (X11 only, dont need X10)?
My own algorithm works for the most part, but even though I tried to make it as general as possible, I still have too many exception cases and have discovered some images that still dont look right. Although, many programs that claim to view XWDs also screw up, but GIMP seems to be able to view them all. I wish they would release their algorithm for reading XWDs, because I get the feeling there is something tricky there that I just dont know about.
I hope I'm not the only one that had to read in XWDs into Java...
Val

Similar Messages

  • Resizing jpegs

    I'm trying to make a simple program to resize jpegs and save them at a specified size but I'm not sure how I should be going about it. If anyone could give me any pointers it would be greatly apreciated. Thanks, Tom.

    You should have a look at the Java 2D API: http://java.sun.com/products/java-media/
    Here's a quick-and-dirty example program to create thumbnail images, it reads a source image and creates a thumbnail image. Works with any file type that your Java runtime environment supports (not just JPEG).
    import java.awt.geom.AffineTransform;
    import java.awt.image.AffineTransformOp;
    import java.awt.image.BufferedImage;
    import java.awt.image.BufferedImageFilter;
    import java.io.File;
    import javax.imageio.ImageIO;
    public class Thumbnail {
        public static void main(String[] args) throws Exception {
            double targetWidth  = 200.0;
            double targetHeight = 150.0;
            // Read source image
            BufferedImage src = ImageIO.read(new File(args[0]));
            double scale;
            int width = src.getWidth();
            int height = src.getHeight();
            if (width > height) {
                // Landscape orientation
                scale = targetWidth / width;
                if (scale * height > targetHeight) {
                    scale = targetHeight / height;
            else {
                // Portrait orientation
                scale = targetWidth / height;
                if (scale * width > targetHeight) {
                    scale = targetHeight / width;
            AffineTransform trans = new AffineTransform();
            trans.setToScale(scale, scale);
            AffineTransformOp op = new AffineTransformOp(trans, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
            BufferedImage dest = op.createCompatibleDestImage(src, null);
            op.filter(src, dest);
            // Write result image
            String outputFormat = args[1].substring(args[1].length() - 3);
            ImageIO.write(dest, outputFormat, new File(args[1]));
    }Jesper

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

  • 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

  • Lightroom 5.6 Export RAW to Resized JPEG Producing Poor Quality Images

    I have the latest Lightroom 5.6 and am running into a problem that I never had EVER and I've been using the same workflow since LR1. I shoot in RAW and want to send my client JPEG proofs (resized to 1000px, 100% quality, and 96dpi, sRGB). I use the export feature and have tried everything, even saving the resized image at 300dpi but the export results are still absolutely horrible. The photo is muddled and blurry no matter what I try. This is obviously not a color space issue, or monitor/browser issue and as I said before, I've done resizing through LR plenty of times without this much compression loss. Anyone else running into this? What's the solution?
    I took the same RAW file and exported to JPEG with resizing checked off and the image looked sharp as a tack like my RAW file in LR.
    So, there is obviously something wrong with LR RAW to JPEG export when resizing. Which has NEVER been an issue before.
    Adobe, seriously, get your S%&T together!

    Never seen anything like that before. I export with resizing all the time. As long as the quality is somewhat up from 80% (100% is complete overkill) and I do appropriate output sharpening, the quality is always superb. Of course there is only so much you can do with a 1000 pixels so don't expect to zoom endlessly in on that. The ppi does not matter at all when you specify a size in pixels. Can you post an example?

  • Resizing JPEG images

    Hey guys,
    I have the following code:
    public static void resize(String original, String resized, int size,
                                  int dimension, float factor)
                throws Exception
            if ((dimension != HEIGHT) && (dimension != WIDTH))
                dimension = WIDTH;
            try
                // get original image
                Image originalImage = new ImageIcon(original).getImage();
                Image resizedImage = null;
                int imageWidth = originalImage.getWidth(null);
                int imageHeight = originalImage.getHeight(null);
                if (dimension == WIDTH)
                    resizedImage = originalImage.getScaledInstance(
                            size, (size * imageHeight) / imageWidth,
                            Image.SCALE_SMOOTH);
                else
                    resizedImage = originalImage.getScaledInstance(
                            (size * imageWidth) / imageHeight, size,
                            Image.SCALE_SMOOTH);
                // this code ensures that all the pixels in the image are loaded
                Image temp = new ImageIcon(resizedImage).getImage();
                // create the buffered image
                BufferedImage bufferedImage = new
    BufferedImage(temp.getWidth(null),
                        temp.getHeight(null), BufferedImage.TYPE_INT_RGB);
                // copy image to buffered image
                Graphics g = bufferedImage.createGraphics();
                // clear background and paint the image
                g.setColor(Color.white);
                g.fillRect(0, 0, temp.getWidth(null), temp.getHeight(null));
                g.drawImage(temp, 0, 0, null);
                g.dispose();
                // sharpen/soften (depending on factor (-ve for sharpening, +ve
    for softening)
                float[] array = {0, factor, 0, factor, 1 - (factor * 4),
                    factor, 0, factor, 0};
                Kernel kernel = new Kernel(3, 3, array);
                ConvolveOp cOp = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP,
    null);
                bufferedImage = cOp.filter(bufferedImage, null);
                // write the jpeg to a file
                OutputStream out = new FileOutputStream(resized);
                // encodes image as a JPEG data stream
                JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                com.sun.image.codec.jpeg.JPEGEncodeParam param =
    encoder.getDefaultJPEGEncodeParam(bufferedImage);
                param.setQuality(0.7f, true);
                encoder.setJPEGEncodeParam(param);
                encoder.encode(bufferedImage);
            catch (Exception e)
                throw e;
        }which I use for making thumbnails and resizing images uploaded to my site. Thumbnails work fine (possibly due to the smaller size) but when I resize an image I get lots of horizontal lines across resized image.
    The funny think is that when I use this method just in a simple application, running directly under JDK 1.4.1_02 then everything works fine and images turn out fine.
    When the above code runs as a part of my web application, thumbnails work, but larger images end up with the lines across them.
    Any ideas??
    I thought it might have had something to do with the factor parameter I use so I tested it just using 0.0 and the same problem occurs.
    I run Apache 2.0.44 with Tomcat 4.1.18, which by the way also runs with JDK 1.4.1_02 so JDK is not the problem.
    Any help is greatly appreciated.
    Cheers,
    Tom

    hey tom,
    i also use this code and also had these problems. i solved it by adding just one line after your if-else: originalImage.flush();
    else {
    resizedImage = originalImage.getScaledInstance (size * imageWidth)/imageHeight, size, Image.SCALE_SMOOTH);
    originalImage.flush();
    // this code ensures that all the pixels in the image are loaded
    Image temp = new ImageIcon(resizedImage).getImage();
    .

  • Resizing JPEG Files and overwrite existing files

    I've got a folder with about 30 subfolders with JPEGs only. I need to resize all of them to a specific size and they must stay within the subfolder structure they currently reside in. I have selected all of the files (using the show files in subfolders menu setting) and have tried to Export so that the smaller files go back in the original folder and also "Overwrite WITHOUT WARNING". When I do this, LR3 will go through it's process, but will come up with a message like this one:
    Is what I am seeking to accomplish not possible in Lightroom? Or is there another way to do this? I'm about ready to make a Photoshop Action to get this over with but wanted to see if LR can do what I need it to do.

    Thanks for the response. These are not original RAW images, but are images for a project I'm working on. I have all the original RAW files, but they are scattered throughout my library on different volumes. I had originally exported the RAWs into one JPEG folder, then sorted images into a bunch of different subfolders during the editing process. Some files still have camera names and some are renamed, so doing it over again by re-exporting and sorting to move in chunks is not an option. I simply want a way to overwrite the images without having to resort everything back into the different subfolders. Isn't that what the "Overwrite WITHOUT WARNING" should be for? I don't understand why it won't let me overwrite the images.

  • Failed to resize jpeg file

    Hello! I have a method that do resize of the jpeg image:
    private Boolean resizePhoto(String fileName, int destWidth, int destHeight, String destFile) {
            FileInputStream fileInputStream = null;
            FileOutputStream fileOutputStream = null;
            float scaleX,scaleY;
            try {
                fileInputStream = new FileInputStream(fileName);
                SeekableStream s = SeekableStream.wrapInputStream(fileInputStream, true);
                RenderedOp image = JAI.create("stream", s);
                ((OpImage) image.getRendering()).setTileCache(null);
                scaleX = (float)destWidth / (float)image.getWidth();
                if(destHeight==0) scaleY = scaleX;
                else scaleY = destHeight / image.getHeight();
                ParameterBlock pb = new ParameterBlock();
                pb.addSource(image);                    // The source image
                pb.add(scaleX);                         // The xScale
                pb.add(scaleY);                         // The yScale
                pb.add(0.0F);                           // The x translation
                pb.add(0.0F);                           // The y translation
                pb.add(new InterpolationNearest());     // The interpolation
                RenderedOp resizedImage = JAI.create("scale", pb, null);
                fileOutputStream = new FileOutputStream(destFile);
                JAI.create("encode", resizedImage, fileOutputStream, "JPEG", null);
                return true;
            } catch (FileNotFoundException ex) {
                System.out.println("FileNotFoundException");
                ex.printStackTrace();
                return false;
            } finally {
                try {
                    fileInputStream.close();
                    fileOutputStream.close();
                } catch (IOException ex) {
                    System.out.println("IOException");
                    ex.printStackTrace();
                    return false;
        }But cannot resize certain photos and getting an error:
    Error: One factory fails for the operation "jpeg"
    Occurs in: javax.media.jai.ThreadSafeOperationRegistry
    java.lang.reflect.InvocationTargetException
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
            at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1682)
            at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:481)
            at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
            at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:110)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
            at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1682)
            at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:481)
            at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
            at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)
            at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
            at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
            at krakersupdater.PhotoProcessor.resizePhoto(PhotoProcessor.java:181)
            at krakersupdater.PhotoProcessor.doInBackground(PhotoProcessor.java:92)
            at krakersupdater.PhotoProcessor.doInBackground(PhotoProcessor.java:33)
            at javax.swing.SwingWorker$1.call(SwingWorker.java:278)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
            at java.util.concurrent.FutureTask.run(FutureTask.java:138)
            at javax.swing.SwingWorker.run(SwingWorker.java:317)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.OutOfMemoryError: Java heap space
            at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41)
            at java.awt.image.Raster.createPackedRaster(Raster.java:458)
            at sun.awt.image.codec.JPEGImageDecoderImpl.allocateDataBuffer(JPEGImageDecoderImpl.java:338)
            at sun.awt.image.codec.JPEGImageDecoderImpl.readJPEGStream(Native Method)
            at sun.awt.image.codec.JPEGImageDecoderImpl.decodeAsBufferedImage(JPEGImageDecoderImpl.java:210)
            at com.sun.media.jai.codecimpl.JPEGImage.<init>(JPEGImageDecoder.java:114)
            at com.sun.media.jai.codecimpl.JPEGImageDecoder.decodeAsRenderedImage(JPEGImageDecoder.java:53)
            at com.sun.media.jai.opimage.CodecRIFUtil.create(CodecRIFUtil.java:120)
            at com.sun.media.jai.opimage.JPEGRIF.create(JPEGRIF.java:52)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
            at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1682)
            at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:481)
            at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
            at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:110)
            at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at javax.media.jai.FactoryCache.invoke(FactoryCache.java:130)
            at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1682)
            at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:481)
            at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:340)
            at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:830)
            at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878)
            at javax.media.jai.RenderedOp.getRendering(RenderedOp.java:899)
            at krakersupdater.PhotoProcessor.resizePhoto(PhotoProcessor.java:181)
            at krakersupdater.PhotoProcessor.doInBackground(PhotoProcessor.java:92)
            at krakersupdater.PhotoProcessor.doInBackground(PhotoProcessor.java:33)
            at javax.swing.SwingWorker$1.call(SwingWorker.java:278)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)Why I cannot resize some photos ? It is because of color space ? If so, how can I convert from one color space to another ?
    This is link to photo which my function cannot handle: http://www.tvksmp.pl/~filipb/MULSUEEKR0006_LRG.jpg
    Edited by: CheckRaise on Aug 7, 2009 5:43 AM
    Edited by: CheckRaise on Aug 7, 2009 5:47 AM

    I was using ImageIO earlier for resizing but then got problems with jpg in another color spaceYou can save a JPEG in CMYK color space. The JPEGImageReader in core java is unable to read such jpegs, and will throw an IOException complaining that it can't. Although JAI won't throw an exception, it to isn't able to properly read the jpeg. JAI interprets cmyk images as argb images and the colors get all screwed up.
    And why this function consumes so much memory?What's the size of the largest image you are reading? And to what size are you scaling it?

  • 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

  • Pixelation issue resizing jpeg Logo - Illustrator CS5

    I'm working on a file where they've supplied me with their logo only in jpeg format. I'm trying to lower the size for the small artboard (to approx 15% of it's original size) but can't find any way to make it even the slightest bit smaller without noticable pixelation - let alone an 85% reduction. This will ultimately be print ad so I'm trying to keep resolution in mind.
    I'd appreciate everyones expertise! (Illustrator fixes only please as I do not have photoshop)

    I wasn't looking at it in overprint preview but did since your message and it makes no difference. It is for a small newspaper ad 2"x3.5" so I of course need the logo to been even smaller than that.
    Here is the provided jpeg image:
    Here it is at 15%:
    As for looking at it in 100%...(perhaps is my lack of advanced illustrator knowledge)....I've always found at 100% it is not true to scale - somewhere around 155/156% I find is true to scale when printed.

  • Trying to resize jpeg in Preview but says I don't have permission...

    I have always resized images in Preview but this time around I keep getting an error message (screen shot attached) that I don't have permission to make any changes even after checking/changing when I right-click>Get info... I clicked on the little padlock on the corner, i changed the settings for (me) and everyone to Read & Write (screen shot at bottom of post), i deleted/copied the images again and again, renamed it, tried to Save-As, and it still doesnt work.. It's driving me crazy... Any body else having this problem?
    (btw, i couldn't even resize the screenshot so that it would fit within the required dimensions, gave me the same error msg)...

    I don't have this problem (yet) but when I save a "New from Clipboard" image the resize tool is dimmed.  When I close the image and re-open it I can resize it - my fingers a wearing out closing and re-opening files all day......
    Sorry not to be of help but I must say I liked the old Preview....

  • Again: oversharpening on resized jpeg export!

    This thread
    http://discussions.apple.com/thread.jspa?messageID=1634055&#1634055
    is closed so there's no way to move it up. IMO this is weird not to give an ability to control (or turn off) sharpening while modifying export presets. Web Gallery function is almost useless while I can't turn off this excessive sharpening!

    I really don't see why you would be having difficulty with this.
    You can control the amount of sharpening per image in a web export an individual jpg file export. You do this by using the image editor HUD and adjusting the sharpening, edges, and chroma blur. The nice thing is that while making adjustments to the images in one particular area, the adjustments do not affect any other versions of the image within Aperture.
    Image appearance also depends on your export preset, e.g. best quality, high quality, medium quality, low quality, etc.
    I did a web export using the same image at the same quality settings but with different sharpening adjustments. As I suspected, the images displayed on the web pages appeared differently: one being very sharp and the other being somewhat soft.
    Frankly, I think more people need to take the time to learn how to use this tool properly and effectively before making complaints. Yes, Aperture is not perfect and needs some tweaking, but much of what people complain about simply isn't justified.

  • Resize JPEG and GIF'S Images - JSP

    Java greetings!
    Somebody knows as can make to create an image pequena(sendo the miniature), without losing quality?
    therefore I am making upload of images, that are recorded in the DB... are wanting to make in the following way: thus q the user to make upload of the image, is created a miniature of the image and kept original(having been image GREAT).
    Somebody can help me? or to indicate some classroom and examples so that it can make this?
    Since already I am thankful!

    how I make to use the thumbnail Classroom with my Servlet, therefore the thumbnail classroom uses parameters of String and the binary Servlet. as to decide this?
    Since already I am thankful!
    package com.brutus;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class BlobUploadServlet extends HttpServlet{
    private static String dbUserName = "root";
    private static String dbPassword = "";
    private static String urlDb = "jdbc:mysql://localhost/test";
    private static final char CR = 13;
    private static final char LF = 10;
    protected String boundary = null;
    protected Hashtable params = new Hashtable();
    public void doPost( HttpServletRequest request,HttpServletResponse response )
    throws ServletException, IOException{
    ServletOutputStream out = response.getOutputStream();
    ServletInputStream in = request.getInputStream();
    BufferedInputStream bin = new BufferedInputStream(in);
    boundary = getBoundary(request.getHeader("content-type"));
    out.println("<html><body><pre>");
    out.println("boundary =\n"+boundary);
    out.println();
    byte[] bytes = new byte[128];
    in.readLine(bytes,0,bytes.length);
    String line = new String(bytes);
    Hashtable header = null;
    while(in.readLine(bytes,0,bytes.length)>=0){
    line = new String(bytes);
    if(line.startsWith("Content-Disposition:")){
    out.println(line);
    header = parseHeader(line);
    updateParams(header);
    }else if(line.startsWith("Content-Type:")){
    params.put("Content-Type",
    line.substring("Content-Type:".length()).trim());
    }else{
    if(header!=null&&bytes[0]==13){
    if(header.containsKey("filename")){
    displayParams(out);
    out.println(" ...saving payload");
    savePayload(params,bin);
    header = null;
    }else{
    String name = (String)header.get("name");
    String value = getParameter(in).trim();
    params.put(name,value);
    }if(line.indexOf(boundary)>=0)
    out.println(line);
    bytes = new byte[128];
    out.println("</pre></body></html>");
    out.close();
    private void displayParams(ServletOutputStream out)
    throws java.io.IOException{
    for (Enumeration e = params.keys();e.hasMoreElements();) {
    String key = (String)e.nextElement();
    out.println(" "+key+" = "+params.get(key));
    private void updateParams(Hashtable header){
    for (Enumeration e = header.keys();e.hasMoreElements();) {
    String key = (String)e.nextElement();
    params.put(key,header.get(key));
    private String getParameter(ServletInputStream in)
    throws java.io.IOException{
    byte[] bytes = new byte[128];
    in.readLine(bytes,0,bytes.length);
    return new String(bytes);
    private String getBoundary(String contentType){
    int bStart = contentType.indexOf("boundary=")+"boundary=".length();
    return "" + CR + LF + "--" + contentType.substring(bStart);
    private void savePayload(Hashtable params,BufferedInputStream is)
    throws java.io.IOException{
    int c;
    PushbackInputStream input = new PushbackInputStream(is,128);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    while ( (c=read(input,boundary)) >= 0 )out.write( c );
    //int id = Integer.parseInt((String)params.get("ID"));
    saveBlob((String)params.get("filename"),out.toByteArray());
    out.close();
    private int read( PushbackInputStream input, String boundary )
    throws IOException
    StringBuffer buffer = new StringBuffer();
    int index = -1;
    int c;
    do {
    c = input.read();
    buffer.append( (char)c );
    index++;
    while ( (buffer.length() < boundary.length()) && (c == boundary.charAt(index)) );
    if ( c == boundary.charAt(index) ){
    int type = -1;
    if ( input.read() == '-' )
    type = -2;
    while ( input.read() != LF );
    return type;
    while ( index >= 0 ){
    input.unread( buffer.charAt(index));
    index--;
    return input.read();
    private Hashtable parseHeader(String line){
    Hashtable header = new Hashtable();
    String token = null;
    StringTokenizer st = new StringTokenizer(line,";");
    while(st.hasMoreTokens()){
    token = ((String)st.nextToken()).trim();
    String key = "";
    String val = "";
    int eq = token.indexOf("=");
    if(eq <0) eq = token.indexOf(":");
    if(eq >0){
    key = token.substring(0,eq).trim();
    val = token.substring(eq+1);
    val = val.replace('"',' ');
    val = val.trim();
    header.put(key,val);
    return header;
    public void saveBlob(String description,byte[] out){
    String cmd = "INSERT INTO Photos (Description,Image) VALUES(?,?)";
    System.out.println(cmd);
    try {
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = DriverManager.getConnection(urlDb,dbUserName,dbPassword);
    PreparedStatement pstmt = con.prepareStatement(cmd);
    pstmt.setString(1, description);
    pstmt.setBytes(2, out);
    System.out.println(pstmt.executeUpdate());
    con.close();
    catch(ClassNotFoundException e){
    e.printStackTrace();
    catch(SQLException e){
    e.printStackTrace();
    }

  • Image Processing- comparing JPeg files

    Hi All,
    sorry for posting this question at this forum, but I could not find a separate forum for Image Processing. (although i could search for such forums, but i believe they are taken off.)
    I want to compare one input jpeg file with 10 existing files and find the closest match.
    can someone give me pointers to start with. i believe there are tools to achieve this.
    thanx n regards

    Not sure about the way you are using, but look at these links.
    Resizing Photos for Emailing
    http://www.apple.com/pro/tips/emailresize.html
    Resize!
    http://kstudio.net/
    PhotoToolCM
    http://www.pixture.com/software/macosx.php
    SmallImage
    http://www.iconus.ch/fabien/smallimage2/
    ImageTool
    http://www.macupdate.com/info.php/id/23281
    ImageWell
    http://www.xtralean.com/IWOverview.html
    Resize JPEG Files
    http://www.macworld.com/weblogs/macgems/2006/09/jpegresize/index.php
     Cheers, Tom

  • How can I bring the file size of jpegs down to ~60k?

    Hi. I like to resize my photos to 800x600, 72dpi for upload to the web. Now, my cameras are usually set to maximum resolution, which can include 180 or 300dpi, but I can find no Automator action to change the dpi. Using Preview and/or Graphic Converter I always end up with a file size of ~270k which quite frankly is rubbish - if I do the same process in The GIMP it is typically ~60k with no visible loss of image quality, however The GIMP does not appear to be compatible with Automator.
    My question is this: is there any way of making my jpegs ~60k without going below the 65% jpeg quality setting? Is there a free app that I can use? If I had Photoshop I would just use its Actions to batch process files, but I don't so I can't.
    Any help would be much appreciated!
    iMac 17inch   Mac OS X (10.4.9)   My other Mac is a Cube

    Here's some links I collected.
    Resizing Photos for Emailing
    http://www.apple.com/pro/tips/emailresize.html
    Resize!
    http://kstudio.net/
    PhotoToolCM
    http://www.pixture.com/software/macosx.php
    SmallImage
    http://www.iconus.ch/fabien/smallimage2/
    ImageTool
    http://www.macupdate.com/info.php/id/23281
    ImageWell
    http://www.xtralean.com/IWOverview.html
    Resize JPEG Files
    http://www.macworld.com/weblogs/macgems/2006/09/jpegresize/index.php
     Cheers, Tom

Maybe you are looking for

  • Apex upgrade 3.0/3.1 from 2 on Ubuntu 8.04

    Hi all, I was installing Apex 2.0 on Ubuntu linux starting from terminal this command> sudo dpkg -i /home/nadrog/Desktop/oracle-xe_10.2.0.1-1.0_i386.deb and installation was complete. Then I was run db configuration with set 8080/1521/pass and all in

  • How to allow users to run infopackage without giving access to Workbench

    Hi, I have certain infopackages which I want to give access to users to run. It mainly relates to loading of flat files which they want to be able to execute when they want and also loading the P&L  data from R/3. I am on 3.5..I don't want the users

  • RMAN: TSPITR fails wirh RMAN-06024

    Hi everybody, where are trying to create a auxilary database from backupsets which are stored on tape. Now when we want to restore the controlfile with restore clone controlfile the Backup fails with following error: RMAN-00571: =====================

  • How do you use findbykey on an extended entity ???

    The extended entiry creates its own unique row id and it seems you can not use a null to do a partial search ? thanks in advance

  • Safari Bookmarks vanished

    Did some updates on my iPad. Installed instapaper. came to Mac. there might have been a mobileMe sync. Safari bookmarks vanished. Nada. Seem gone from Me and from my Mac. Are they backed up somewhere? HELP!