How to decrease jpeg size without losing quality?

i am creating different size of images reading with bufferedimage then redrawing image with different sizes...
I have created a 500*375 -192 kb picture from original with my code then uploaded it to flickr....it produced 500*375 picture with 133 kb...and quality seems the same...please look my code below...maybe the colour table of my drawing or some property must change....where is the point?
thank you
response.reset();
          ServletOutputStream cikti=response.getOutputStream();
          BufferedImage servletResim=new BufferedImage(500,375,BufferedImage.TYPE_INT_RGB);
          Graphics2D graf=(Graphics2D) servletResim.getGraphics();
          graf.drawImage(image, 0, 0, 500, 375, null);
          JPEGImageEncoder enkoder=JPEGCodec.createJPEGEncoder(cikti);
          JPEGEncodeParam param = enkoder.getDefaultJPEGEncodeParam(servletResim);
          int quality =100;
          quality = Math.max(0, Math.min(quality, 100));
          param.setQuality((float)quality / 100.0f, false);
          enkoder.setJPEGEncodeParam(param);
          enkoder.encode(servletResim);
          cikti.close();

The quality may "seem" the same, but it probably isn't. With most photos you can reduce the JPEG to 85% quality without noticing much.

Similar Messages

  • How to decrease PDF file size without losing quality of images and vector lines?

    I have several ai files that I saved as PDFs. Now I'm having problem with the size of this combine files. Can some one assist me with the proper way on decreasing file size without losing quality.
    Thank you.

    I am having the same problem with a different file that's in a different format mentioned above. I'm trying to convert a ".srf" file and turn it into a ".pdf." I was successful doing this but my image, once in a .pdf was also pixilated.
    I thought if I convert my ".srf" file to a ".jpeg" first, then bring this newly created ".jpeg" into a ".pdf," I would have more luck. But unfortunately the free download I got on my computer that's supposed to convert any file to any file, CANNOT convert ".srf" files to ANYTHING!
    Does anyone have any ideas? Or any specific programs I should get?
    Thanks!

  • How to resize large images without losing quality

    Hello I have an image that I am trying to use as an email. Right now it is 2108 pixels. And for an email it should be 600 px. I created this image in illustrator as vectors and type.
    Whenever I go into image size and i change it to be 600 pixels it gets extremely blurry. I have also tried converting this to a smart object... doesnt work. How do I resize my large image to be smaller without losing quality???

    here is an example sceenshot of the opening dialog (.ai opened directly in Photoshop)
    your illustrator vector should be rastered sharp at 100% actual Pixels in Photoshop
    that is where you want to evaluate sharpness in Photoshop...
    then File> Save for Web & Devices (and drag that saved file icon into an open web browser)
    still no joy, embed your saved image here using the forum's camera icon...

  • How can I resample image without losing quality?

    I have an image which is 1200 x 800 at 72 pixels per inch
    Now it is needed on a webpage so it needs to be small - I am told the image has to be 300 x 200
    I want to maintain the quality.....
    SO......
    I get the original image: thus...
    I then bring up the image resize dialog which shows:
    I change the values so that the image dimensions are changed to 300 x 200 thus:
    1200 changed to 300 - this changed the 800 to 200 for me... pressed OK
    The resultant image is now:
    Looks awful - What am I doing wrong?
    Thank you in advance.
    Terry

    Any time you interpolate an image you will lose some image quality. For you either reduce the details you have for an image or your creating details you don't have for the image. The image you started with had better quality but that image no longer exist you have a new image now.
    The size change and direction has a lot to do with how much the quality change is.  If you throw away a lot of detail the smaller resized image my look very good on a display.  However  you resize a small web image to a 16" x 20" 300dpi print image it will not look good.
    If the image has been sharpened using Bicubic Automatic or bicubic sharper is not a good interpolation method when downsizing for the web. Still there is just so much detail you can retain in 300x200 pixels.

  • How can I convert MPEGs without losing quality?

    Hi Guys
    Ok, to start, I have a MAC OS X 10.4.11/ Final Cut Pro 5/ new 1TB external hard-drive/ from UK
    So, I am new to FCP and not very tech savvy. Please be gentle with me....
    Basically, I have some video files I would like to edit on FCP. They are MPEG2 files on my computer (I don't have access to the camera anymore). I realise that you can't edit MPEGS on FCP so I need to convert them to an appropriate format.
    I have tried to convert them to something usable by using 'Mpeg streamclip' but it says I have to install (and pay for) the 'MPEG-2 playback component' to convert MPEG2s. I have therefore used iSquint to convert the MPEG2s to MP4s, which I then convert to DVCPRO50 on 'Mpeg streamclip'!
    This worked, BUT, the quality is really compromised. The DVPRO50 video is less sharp and the colours are drained in comparison to the original MPEG2 vids. Considering the camera I used was quite bad in the first place, I really can't afford to lose any picture quality. *SO, is there any way I can convert the MPEG2 video clips to a usable format that I can edit on FCP without compromising the quality?*
    sorry it's long-winded but I wanted to include all the information!! CHEERS!
    _NOBODY TRY AND SELL ME ANYTHING- I'M NOT BUYING IT._

    If you have Final Cut Pro, you should have the mpeg2 component. I understand it is removed in some cases during upgrades. Do a search and you should find the instructions for reinstalling it. (edit: the nice poster just above this post provided the link to mpeg streamclip site where you can find directions for reinstalling the mpeg2 component.)
    Once you have the QT mpeg2 component reinstalled, use either mpeg streamclip or compressor to convert the material to whatever codec makes sense - most likey DV/NTSC (or DV/PAL) Quicktime. DV50 won't help matters unless you are planning to composite text or do some color correcting. The additional chroma depth in its 4:2:2 format will assist there. If you are simply doing cuts, DV's 4:1:1 is fine.
    SO, is there any way I can convert the MPEG2 video clips to a usable format that I can edit on FCP without compromising the quality?
    No. All transcoding will affect the image some. Your material will take at minimum 3 hits. The lousy camera>mpeg2 encoding>transcoding to an editable format.
    NOBODY TRY AND SELL ME ANYTHING- I'M NOT BUYING IT.
    This is rather rude and doesn't make a compelling first impression.
    x
    fwiw - you have a Mac, not a MAC. A MAC is the Media Access Control address. You can read all about it HERE.

  • How to proper resize images and videos at runtime without losing quality?

    Hi guys. I need a bit of help here.
    I've built a flash site in which i want to resize a movie to the stage. I do it by keeping the proportion, thus i only resize the width and then i resize the height acordingly to the new width but keeping the proportion.
    The problem is that my film still looks "pixeled".
    I found a website on which the stage resizes dinamically with the movie and the background images without either of them losing quality. Till now i knew that resizing images or videos in flash at authoring or runtime produces pixeled results.
    This is the website: http://kampanjeweb.apt.no/jotun/romforrom/. Can someone tell me how do they do it without losing quality? just make the browser windowed and resize the margins to see the effect.
    Thanks.

    Hello, Venian.
    About the video, you could try setting the flash.media.Video's smoothing property to TRUE. This should keep a quality, but you can do nothing if the video has a poor quality. You need a great video.
    About the images, you you need to redraw the image each time you resize it. To achieve it, use a combination of Bitmap, BitmapData and Matrix classes. Any doubt, just call again. Here is a simple example:
    var scale:Number = .5;
    var highQualitySourceImage:Bitmap = ...your image...;
    var scaleMatrix:Matrix = new Matrix();
         scaleMatrix.scale(scale, scale);
    var bitmapData:BitmapData = new BitmapData( scale*highQualitySourceImage.width, scale*highQualitySourceImage.height);
         bitmapData.draw(highQualitySourceImage, scaleMatrix);
    var finalBitmap:Bitmap = new Bitmap(bitmapData);
    addChild( finalBitmap );
    Cheers,
    CaioToOn!

  • How to decrease the size of an image (CS5)?

    I need help with how to reduce the size of an image to fit various smaller sizes.  E.g. 135 x 380mm, 254 x254mm etc mounted/matted. Therefore, the image must be made smaller than these sizes without losing quality and any part of the image. I am unable to crop to achieve these sizes since I need the full image. These photos were taken by using a Canon D450 camera and in both RAW & JPEG.
    Your help is much appreciated.

    You may want to use Image > Image size... and dial in the sizes you want.
    Set your units to mm in the dialog. Turn off resample and you can adjust the final print size.
    What I am showing you is called "scaling", changing the print size without throwing out pixels as resample would do. Your image is  intact. This is from CS6, but it should be about the same in CS5.
    Gene

  • How do I edit a .mov file in iMovie '09 without losing quality?

    Hi!
    Can anyone tell me how to edit .mov files in iMovie '09 without losing quality?
    I have perfectly fine looking screen capture video from iShowU. It's 1024x768, 30 fps, Animation compression codec. It's a .mov file that looks great played in the QuickTime player. I can't even tell it's a movie -- it just looks like the screen I captured.
    Now, I bring it into iMovie '09, trim the ends, and Export to QuickTime using no compression and the same fps and size. The output quality is noticeably lower than the input quality, which makes no sense to me because I'm telling the export not to compress (and my Preferences are set to "Import HD video as Full-Original Size".
    I just want to trim the ends off a video -- maybe combine a couple files -- but without wrecking the quality of the originals. That really doesn't sound like it should be all that hard, but so far, it's been impossible.
    Any pointers are greatly appreciated!!
    -- gnagent

    I've found the answer. On the File/Import/Movies... dialog, uncheck "Optimize Video" even if you have "Full - Original Size" selected. You don't want any optimizations done, even at original size. Then make sure you are exporting at precisely the same size as the original file, which means that under the Export to Quicktime/Options/Video Size dialog you do NOT want to check "Preserve aspect ratio using:" Just use "Custom" size and set your size to exactly what "Get Info" tells you when you view the file in the Finder.
    Make sure that Video/Settings is set to Compression Type: None, and that you have the Frame Rate exactly what your original was.
    Hope this helps someone.
    -- gnagent

  • How to burn an iMovie to DVD without losing quality? I have iMovie 10.0.5 and imac 10.9.4 mountain lion. I do not have iDVD. After iMovie goes through the encoding process, quality is horrible. How can I fix this?

    How to burn an iMovie to DVD without losing quality?  I have iMovie 10.0.5 and iMac 10.9.4 mountain lion. I do not have iDVD. After iMovie goes through the encoding process, quality is horrible. How can I fix this problem? I have tried the apps BURN and DVD Creator for MAC. I need to finish this DVD asap and becoming more and more frustrated. Why would Apple give us iMovie and not provide us an app to burn it to a DVD and / or take away the iDVD?
    Alicia McGinnis

    Why is there no iDVD on my new Mac? How do I get it and how do I install it?
    https://discussions.apple.com/docs/DOC-3673
    To burn a DVD with iDVD from the latest version of iMovie, you have to export the movie using the Export button and select 480p as the size. Open iDVD and start a new project, then drag that exported movie file into the iDVD menu window, avoiding any drop zones you see.

  • How to export a slideshow in iPhoto 9.5 without losing quality

    Hi
    Would appreciate comments from the forum on how to best export a slideshow in iPhoto 9.5 without losing quality. I tried the highest quality option on the export menu but still noticed a signficant degradation in the quality of the slideshow in iPHoto vs the exported file.
    I read some of the posts on earlier versions of iPhoto were the "Custom Export" could be used but understand this functionality has been removed from the latest version (iPhoto 9.5).
    Any help would be greatly appreciated!

    In iPhoto, when you play a slideshow it's showing you the actual photos.
    After export , you're watching a movie made from these images. The process of exporting to a movie necessarily involves compression. Even HD export is still about 2 MP range. If you're shooting 6, 10, 12 or more MP images there is an inevitable loss of data. The enormous stills from your camera are being squeezed down into HDTV quality. It's even worse if you try export for a DVD. TV avoids this by not shooting such high quality images.
    So, what you can try is use another app and one that has different algorithms for this process. Frankly, it'll be a process of trial and error to find the one that works best for your images.
    Alternatives to iPhoto's slideshow include:
    iMovie is on every Mac sold. It's worth a try, though it only has the same export options as iPhoto now. Older versions had more.
    Others, in order of price:
    PhotoPresenter  $29
    PhotoToMovie  $49.95
    PulpMotion  $129
    FotoMagico $29 (Home version) ($149 Pro version, which includes PhotoPresenter)
    Final Cut Pro X $299
    It's difficult to compare these apps. They have differences in capability - some are driven off templates. some aren't. Some have a wider variety of transitions. Others will have excellent audio controls. It's worth checking them out to see what meets your needs. However, there is no doubt that Final Cut Pro X is the most capable app of them all. You get what you pay for.

  • How to export from iMovie HD without losing quality?

    I created a movie in iMovie HD made from clips from my camera which records great quality HD video, and now I want to export it and save as a movie file so that I can import it into iMovie '09 as part of a larger project. However, every time I try to export it, the resulting file has noticeably worse quality than when I view it in iMovie HD. I have tried the "full quality" option which exports as a .mov file, but the quality is much worse. I have also tried "Expert settings" choosing DV, AVI and MPEG-4 and have changed the settings to the best options I could find, but still the quality is worsened every time. How can I export my video without losing quality??

    Do you mean import what I have in iMovie 09 into iMovie HD/06 instead? I suppose I could but I wanted to add some of iMovie 09's titles and adjustment effects to my iMovie HD/06 project, so it could get quite complicated trying to piece it all together. I may have to do that as a last resort, but does anyone know any way I can get around this?
    I would think there must be some way to save my iMovie 06 file as something other than an iMovie file without losing quality... but things aren't always that easy are they?

  • How can I save a Flash or .swf file in AVI format without losing quality?

    How can I save a Flash or .swf file in AVI (or another video) format without losing quality?

    As long as you don't have code in your animation then just hit File->Export->Export Movie, then configure the options.
    Here's an article on exporting sound, images and video. Just skip on down to exporting AVI and it explains the process. The codec is in the Video Compression section. When you click Settings for Video Compression, the codec is in the drop-down at the top. There's various kinds but to get lossless quality AVI you'll have to choose Uncompressed / None for full quality. Again, the file will be huge and you'll need to use another program (like Adobe Media Encoder) or Microsoft Windows Media Encoder, etc, depending on what format you intend to compress it ultimately.
    http://helpx.adobe.com/flash/using/exporting.html#exporting_video_and_sound

  • Is there a way to change clip size without losing image quality? Specifically from 568 x 320 to 1920 x 1080?

    Is there a way to change clip size without losing image quality? Specifically, from 568 x 320 to 1920 x 1080?

    No, especially not video files. That's way too much scaling.

  • How to increase the image size without losing resolution in iPhoto?

    Dear All
    I have pics i took with my phone which is not an iphone, just little sony ericsson phone.
    Is there a way to increase the image size without losing resolution in iPhoto please? Or cheap 3rd party software or shareware perhaps?
    thank you very much.
    veedeekay

    iPhoto has no way to do that. You'll need an external editor for the job. Not all have the capability. I know Photoshop has.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    Regards
    TD

  • Resize A Image Without Losing Quality

    I have been reading about how to best resize image in PS CS4/CS5.  I've read that you should increase the size of a image in increments and I’ve also read that you should resize using the bicubic smoother setting in PS.
    The image that I would like to resize is 5W x 7H and resolution of 150. I would like to print this image at 30W x 40H on a HP Designjet 5500ps.
    Any recommendation on how I should go about resizing the image without losing quality?

    No matter which method you used, scaling up a photo 5 times is going to look very good.
    There are some software that purports to scale up an image without blurry edges. Not sure how well they work.
    If you can obtain the original image and rescan it at a higher resolution that would work better.
    Or, if the photo can be easily recreated as a vector drawing, then do that with illustrator and print it out large.
    Or if you or someone you know is a great artist, then scale up the photo in photoshop (which would become blurry), then hand correct the edges to make them sharp. This requires drawing ability.

Maybe you are looking for