The best way to compress photos

They have: 9 posts

Joined: Mar 2004

I want to get highest quality from small file size.

Which format is the best for pictures? Is it still JPEG or maybe there is something new?

What software I should to use to get best quality with small file size?

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

JPEG is best for photos. You could try PNG but JPEG is still the standard. There are a several programs out there to compress photos. What you use depends on your budget and what other software you have. Adobe Photoshop/ImageReady is what I'm most familiar with and I think it does a great job.

They have: 9 posts

Joined: Mar 2004

Megan wrote: JPEG is best for photos. You could try PNG but JPEG is still the standard. There are a several programs out there to compress photos. What you use depends on your budget and what other software you have. Adobe Photoshop/ImageReady is what I'm most familiar with and I think it does a great job.

I have Photoshop, but I thought maybe there are some better software to compress JPEGs. I mean some big websites has really big pictures with good quality and small file size. Photoshop can't compress this way.

demonhale's picture

He has: 3,278 posts

Joined: May 2005

maybe you havent saved in your photoshop the image in jpg at internet settings...

They have: 9 posts

Joined: Mar 2004

demonhale wrote: maybe you havent saved in your photoshop the image in jpg at internet settings...

I use Save For Web...

demonhale's picture

He has: 3,278 posts

Joined: May 2005

sometimes, they limit their number of color sets and decrease the number of colors before saving, that way a big image would use lesser space...

1. count colors used
2. decrease number of colors on image based on the count
3. save for web in jpg

try it out and it will do you some tricks...

They have: 9 posts

Joined: Mar 2004

demonhale wrote: 1. count colors used
2. decrease number of colors on image based on the count

How can I do this?

They have: 5,633 posts

Joined: Jan 1970

demonhale wrote: sometimes, they limit their number of color sets and decrease the number of colors before saving, that way a big image would use lesser space...

Thats a gif.

Here is your image format breakdown...
JPEG - Large images with alot going on in them
GIF - small images or images with under 256 total colors in them. For small graidents only.
PNG - Generally larger for better quality but IE never desplays the right colors.
SVG - The future of high performance vector art.

Everything else is eather too large or not used enough.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

bja888 wrote: PNG - Generally larger for better quality but IE never desplays the right colors.

I actually had to dig around quite a bit to find more information on this. I've never heard of that, and I've had no problems using PNG in IE. I came up with this explanation:

http://kas.felinity.net/n197

It's a problem with photoshop embedding information in the file that IE wants to change. So it's not the format, it's partially the browser but mostly Photoshop. Make a PNG in another app (like Fireworks), and it should be fine. The main problem IE has with PNG is with the alpha transparency. This will be supported in the next version.

I like this part from that explanation I linked to:

Quote: Just for the record, the totally free Open Source Gimp has no such trouble. After taking the image over to my Linux box and saving it with the Gimp, it worked like a charm in IE. Maybe if Adobe wasn’t so busy worrying about “piracy” and adding crippleware features, they’d be able to get the basics right.

LOL! Posted that just for you, Jeeves Smiling But I have to point out that BJA was not "absolutely" right Wink (and all the stuff about the GIF's is irrelevant if al9 is talking about photos!)

PNG's are great if you want the best of both worlds basically. Smooth transitions like jpeg, crisp edges like gif.

Now, back to the original question - can we see these pics to get a better idea of what you're talking about? Thanks.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Bryan is absolutely right, what I expect you're seeing with those large pictures is a gif (do right-click save as and check the filename extension).

In Photoshop create a 1024x768 image, put in a colour of your choice with the paint bucket - but only one colour! - then save for web and select gif, check the file size, I guarantee it'll be small even though the image is large!

Although - as said - this isn't suitable for large images with a lot of different colours, when you say "pictures" do you mean photos or just generic images?

Got any examples of both the images you're saving or the ones you found with the small file size?

a Padded Cell our articles site!

Busy's picture

He has: 6,151 posts

Joined: May 2001

Irfanview is awesome for compressing images (without disortion), perfect for digital cam pics as has option to remove all the EXIF crap the camera adds.
I sometimes do stuff in PSP and say as .bmp, then open in Irfanview (crop, resize, enhance or whatever) and save, nice small image size without the dreaded .jpg fuzzies

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

A nice tool I use is Ulead's SmartSaver Pro. It does an excelent job of optimizing images, building Imagemaps, and slicing images (it does roll-overs too, but i don't use it for that).

A nice feature of it is that you can do batch jobs. This is nice if you have a bunch of images and want to quickly make thumbnails of a whole directory, or apply same pallete to a bunch of images at once.

http://www.ulead.com/ssp/runme.htm This is a simple basic program. In fact they still have v3.0 as the current version, the one I bought a while ago when PhotoImpact 7 was just coming out (and now they are up to v10 of that).

-Greg

They have: 96 posts

Joined: Jul 2005

I just use Save For Web with PS CS2 and works great for me. You can drop down to 50% and still get good results.

demonhale's picture

He has: 3,278 posts

Joined: May 2005

As a response to bjas post, you can actually limit the amount of color used in a jpg image, im sure it can be done, i use it all the time. See you actually pointed at the actual color support of different image formats, but jpg as supporting the more color, can be limited to use just the colors you want as you count the number of them existing in an actual photo... its like image hacking, not so because other programs for imaging has the color count and color depth reduction built in for jpg...

They have: 9 posts

Joined: Mar 2004

demonhale wrote: As a response to bjas post, you can actually limit the amount of color used in a jpg image, im sure it can be done, i use it all the time. See you actually pointed at the actual color support of different image formats, but jpg as supporting the more color, can be limited to use just the colors you want as you count the number of them existing in an actual photo... its like image hacking, not so because other programs for imaging has the color count and color depth reduction built in for jpg...

How can I do this?

He has: 286 posts

Joined: Mar 2003

Has anyone here used Pegasus or WinSoft Advanced JPEG Compressor?

I've downloaded demo copies of both, and I'm leaning toward the WinSoft. However, I'd like to hear from someone with experience. My two web sites need photos to be compressed, so I can bring the overall page size down to about 40k. I'd like the photo sizes to remain 400x300, at 72dpi.

I'm using Paint Shop Pro to size the photos - some of them scanned, some from a digital camera.

Thanks,

demonhale's picture

He has: 3,278 posts

Joined: May 2005

look on your current image editing program if you do have a count colors used option, then chech if theres a menu for decrease number of colors used. do the tips on the previous post before saving...

They have: 9 posts

Joined: Mar 2004

demonhale wrote: look on your current image editing program if you do have a count colors used option, then chech if theres a menu for decrease number of colors used. do the tips on the previous post before saving...

I use latest Photoshop. But I don't know how exactly I can decrease number of colors used.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

demonhale wrote: As a response to bjas post, you can actually limit the amount of color used in a jpg image, im sure it can be done, i use it all the time.

Please prove this and make sure you've got your facts right before posting! I don't think you can really do this and I also doubt it'll have any effect on image size due to JPEG having a completely different compression routine than gif... Hence the different uses.

al9 sorry for this confusion, but please don't bother trying this until demonhale can explain exactly how he does this!

Which should be easy if you do it all the time, right?

a Padded Cell our articles site!

Roo's picture

She has: 840 posts

Joined: Apr 1999

You cannot reduce colors in a jpeg!

The 'lossy' compession algorithm is not the same as the algorithm used in gif and png.

.gif and .png can use colors as so:
2, 4, 8, 16, 32, 64, 128, 256

As stated:
jpeg for photos and complex images including images with texture.

gif or png (png actually is a weightier file) for plain text images, logos that don't contain any photo quality elements, and simple images (plain color with no complex elements such as photos gradients etc. etc.)

png with alpha transparancy retains a transparant background that can be used against any background no matter what color or texture, however it isn't supported by IE which unfortunatly is the one used by the majority.

png with alpha transparancy can be useful in print..however, tiff works better for this since tiff also retains transparancy.

Roo

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Roo wrote: gif or png (png actually is a weightier file) for plain text images, logos that don't contain any photo quality elements, and simple images (plain color with no complex elements such as photos gradients etc. etc.)

Actually, I've had really good success with using PNG with gradients. Works great for stuff that has a combination of straight edges and gradients. If I could, I would show you the new TWF logo and you'd see what I mean.

Just want to make sure we're clear on this Smiling

Roo's picture

She has: 840 posts

Joined: Apr 1999

Photoshop has png 8 and png24 which is png with alpha transparancy. Is it the latter which does well with gradients? Does it work well with drop shadows too?

Roo

demonhale's picture

He has: 3,278 posts

Joined: May 2005

To prove you can do this, as I am on vacation right now, and all I have here is a trial version of Paint Shop Pro 7 from Jasc...

Find a suitable jpg, I used a 400 000+ byte image, opened it in PSP7 and went first to colors>count colors used ... it counted 233 444 colors on the pic, so I then went to colors>decrease color depth .... options are 2 colors 1-bit (bad) ... 16 colors 4-bit (bad too) ... 256 colors 8-bit (default of a gif file but not to be used in this case to maintain quality of picture) ... 32K colors 24-bit (ok now) ... 64K colors 24-bit (ok still) and lastly ... X-colors 4/8 bit ... I chose 32 k for acceptability ... it reduced the file size by 15% enough if youre trying to squeeze more juice from a full sized and colored image... when an image is mostly green and blue, the color count is lower, so I can use a 256 color series but still save it as jpg but at this point it is advised you save it as a gif for a lower file size... theres a bunch of trick to "acceptable" 256 color images from a full color depth image...

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

I played with that a little bit in Photoshop using the indexed colour method described on this page:

http://www.adobe.com/education/webtech/CS/unit_graphics1/pcb_print.htm

And was unable to obtain a smaller file size while maintianing quality. I'm not sure if there is some other way of going about it or not.

Roo - I didn't have time to test that out last night. Here is some info on the difference between PNG-8 and PNG-24:

Quote: There are two types of PNG: PNG-8 format, which holds 8 bits of colour information (comparable to GIF), and PNG-24 format, which holds 24 bits of colour (comparable to JPEG).

from here: http://www.elated.com/tutorials/graphics/general/image_formats/ (note that the bit on browsers not desplaying them is pretty much redundant now.). PNG is also an open format.

I tried a test image in photoshop with a strong gradient and I found that the PNG-8 did a much better job on the gradient than a GIF with the same colour depth and dither settings.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Right, so you got a 15% reduction, that's not much and is not a typical method for reducing JPEG file size.

This effect is to be expected when removing data from an image, but is not the way in which JPEG compression works!

The following content is old (and in some ways outdated, gif can certainly now store more than 256 colours!), but makes sense and answers the original question quite well (http://www.faqs.org/faqs/jpeg-faq/part1/):

Quote: Generally speaking, JPEG is superior to GIF for storing full-color or
gray-scale images of "realistic" scenes; that means scanned photographs,
continuous-tone artwork, and similar material. Any smooth variation in
color, such as occurs in highlighted or shaded areas, will be represented
more faithfully and in less space by JPEG than by GIF.

I've read most of: http://www.hpl.hp.com/loco/HPL-98-193R1.pdf the LOCO-I JPEG Compression Algorithm Specification and, although I don't profess to understand much - it seems that JPEG reduces the number of bits required to describe a particular pixel within an image by refining the possible values allowed, this process being: Quantization. These lossy algorithms will not really be helped by manual colour depth reduction, in fact it's probably better to let the algorithm decide how to do this using it's own predictive methods.

GIF is lossless, the LZW algorithm takes advantage of repetition in the data contained within the image data, so if two pixels are exactly the same, and next to each other, LZW can compress them. Reducing the number of colours within the image will have the effect of making compression better as more pixels will be alike. I got this information from: http://www.danbbs.dk/~dino/whirlgif/lzw.html - sorry for how this site looks, but the information seems good (remember not a lot has changed with these algorts since the late 90's!).

demonhale, your information is flawed, you can of course reduce the amount of space required to display an image by reducing the colour depth but this has no relation to the JPEG compression algorithm.

Please stop confusing the issue by typing before thinking! Smiling

a Padded Cell our articles site!

demonhale's picture

He has: 3,278 posts

Joined: May 2005

JeevesBond wrote: Right, so you got a 15% reduction, that's not much and is not a typical method for reducing JPEG file size.

This effect is to be expected when removing data from an image, but is not the way in which JPEG compression works!

I've read most of: http://www.hpl.hp.com/loco/HPL-98-193R1.pdf the LOCO-I JPEG Compression Algorithm Specification and, although I don't profess to understand much - it seems that JPEG reduces the number of bits required to describe a particular pixel within an image by refining the possible values allowed, this process being: Quantization. These lossy algorithms will not really be helped by manual colour depth reduction, in fact it's probably better to let the algorithm decide how to do this using it's own predictive methods.

demonhale, your information is flawed, you can of course reduce the amount of space required to display an image by reducing the colour depth but this has no relation to the JPEG compression algorithm.

Please stop confusing the issue by typing before thinking! Smiling

With all due respect mr bond I never said its part of the compression algorithm of jpegs, but you could "reduce the number of colors used" ; it still uses the same bit depth although it fairly reduced the file size, as I said if you want to squeeze more juice. Its fairly useless as 15% in a big image, but then how about if I use smaller images and a 4kb file becomes just 3kb, it would be enough of a reduction for me without affecting the quality of the pic...

Not far from a suggestion to the original question of this thread, he specifically asked how he can do this with a JPEG not a GIF not a PNG...

I know a lot of tricks for GIF, ill give them if that was the question for this thread... Wink

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

You know, I've found the best way to compress photos is to fold them in half, then in half again. They then fit neatly in smaller pockets than they would otherwise.

(Sorry, I've been holding that back since this thread was originally posted.)

DaveyBoy's picture

They have: 453 posts

Joined: Feb 2003

timjpriebe wrote: You know, I've found the best way to compress photos is to fold them in half, then in half again. They then fit neatly in smaller pockets than they would otherwise.

(Sorry, I've been holding that back since this thread was originally posted.)

Very poor, mate!

They have: 96 posts

Joined: Jul 2005

Wow!

War Of The
FORMATS

Roo's picture

She has: 840 posts

Joined: Apr 1999

The original quesion did not ask specifically about jpeg compression.

The original post:

The best way to compress photos

Quote: I want to get highest quality from small file size. Which format is the best for pictures? Is it still JPEG or maybe there is something new?

What software I should to use to get best quality with small file size?

Roo

Busy's picture

He has: 6,151 posts

Joined: May 2001

Ideally you want to resample the images rather than resize.
If you are dealing with digital photos make sure you are removing the EXIF (cameras information).

an example: A 1.2mb camera image, saved at 99dbi and just removing the EXIF will take the image to 300kb. a lot depends on the image itself, how many colours etc so results may vary.

He has: 286 posts

Joined: Mar 2003

If you are dealing with digital photos make sure you are removing the EXIF (cameras information).

Can you do that with Paint Shop Pro? If not, how?

Thanks again.Smiling

Busy's picture

He has: 6,151 posts

Joined: May 2001

What version of PSP you got?
I don't find PSP (5 and 6) the best thing to compress images, i use psp to add url's to images but always open and resave in irfanview to compress

I just use ifranview to resample, resize, lighten ... (and remove EXIF), has option on save.

He has: 286 posts

Joined: Mar 2003

What version of PSP you got?

I have version 9, but I'll check out irfanview also.

Busy's picture

He has: 6,151 posts

Joined: May 2001

PSP is up to v9 ? dang, sorry I only have 5 & 6 - anyone with PSP9 able to tell us if there is an option on saving to remove image data (EXIF etc)

I always spell irfanview wrong, the website is http://www.irfanview.com/

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.