SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Lossless compression, jpegtran or better

    In order to speed up the download of my image-rich pages, I am looking for ways to reduce filesize without compromising quality. One bit of advice was to use "jpegtran" for "lossless" compression.
    Where can I download a Windows version of this software?
    Or alterntively, is there better public domain software for lossless compression?

  2. #2
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,184
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by benbob View Post
    Where can I download a Windows version of this software?
    http://sylvana.net/jpegcrop/ seems to be the answer. I've never heard of jpegtran, far less used it, so I can't say whether it does what you want or not.

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I found the site, but not convinced that jpegcrop is the same as jpegtran.
    What do you use for lossless compression?

  4. #4
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,184
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    I don't. I use GIMP and optimise my images, trading off a small loss in quality for a decrease in file size. The loss of quality is small enough that most people won't even notice it, and high-resolution images aren't necessary on any of my sites.

  5. #5
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,184
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    This site has links to Windows binary versions of jpegtran.

  6. #6
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I use Iview for re-sampling/resizing/compressing, and although not huge for the first 50-80% reduction, I can clearly see the difference when expanding the images. I think in my case getting the maximum "value for momey" would be worth the effort.

  7. #7
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    JPEGs have no concept of lossless compression its not part of their standard. You can reduce the size with JPEGTran by having it remove all superfluous metadata from the image but it will not grant miracles.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  8. #8
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    JPEGs have no concept of lossless compression its not part of their standard. You can reduce the size with JPEGTran by having it remove all superfluous metadata from the image but it will not grant miracles.
    Not looking for miracles, but if I can lose 10% of unnecessary bagage on a megabyte of images, I'd take it. Or more accurately: I'd dump it.

  9. #9
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,184
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    Using GIMP, I remove the EXIF data and the thumbnail, which reduces the file size a little. I expect other applications also allow you to do that.

  10. #10
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    I remove the EXIF data and the thumbnail, which reduces the file size a little....
    I use Iview and could remove EXIF data, but how much does that really save? It's just a bit of ascii, so I don't see that being more than about 1 kb.
    Is the thumbnail something that Gimp adds by default? I've never seen any mention of it in other software.

  11. #11
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,184
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by benbob View Post
    I use Iview and could remove EXIF data, but how much does that really save? It's just a bit of ascii, so I don't see that being more than about 1 kb.
    It's generally around 2kb - about 10% of my average image size.
    Quote Originally Posted by benbob View Post
    Is the thumbnail something that Gimp adds by default? I've never seen any mention of it in other software.
    What the Help file says is:
    Save thumbnail
    This option lets you save a thumbnail with the image. Many applications use the small thumbnail image as a quickly available small preview image.
    Whether GIMP is unusual in creating thumbnails, or in allowing the option not to create them, I don't know. If I get a chance, I'll try to save the same image in GIMP and IrfanView and see if there's any noticeable difference in file size. (The thumbnail adds around 10kb.)


  12. #12
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I've used Gimp for years and had no idea it made thumbnails. I guess I assumed those came from my folder system (nautilus).

    I use PNGcrush, though I've noticed that if I index an image first, it doesn't seem to do much reducing (which might be expected) and sometimes increases filesize (which is not expected or wanted). The reason I use it id to remove Gimp's sRGB header. It's empty, because Gimp doesn't really do colour profiles, but just the empty header being there was enough to make Safari on any non-Mac monitor and Firefox on Linux act super retarded with colours. I started using it after hearing web comic artists rave about it, especially the ones who wanted to use their meant-for-print images as a smaller size on the web.

    While I save all my images including photos as png's, I don't put photgraphic style images on the web that way. Plain old jpeg, and I've noticed images seem to degrade very badly very quickly in the Gimp when turning down the quality. Other programs seem to show the artifact much less, at least if the images I see really were brought down to the quality levels the sitemaster claims. Anywhere under level 80 and I can't stand to look at it.

    Sometimes I wish I could save a jpg with low quality, then go back and fill whole areas with a single colour because there's so much artifact, but of course re-saving makes new artifacts even when there's no edges. Arg.

  13. #13
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can I ask if anyone uses png format on the web? I thought there were people doing that now...

  14. #14
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webmeist View Post
    Can I ask if anyone uses png format on the web? I thought there were people doing that now...
    Lots of people are using PNGs and have been!
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  15. #15
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    I use PNGs for everything that's not "photographic". Logos and things work great. Also PNG is a must if you need alpha transparency (though if I can fake it I'll do an indexed image with flat/8-bit transparency... but still as PNG. It's freer-speech than GIF (not that it actually matters) and often still better compression).

    Pretty much anything non-animation you would use a GIF for, PNG can do the job, and often better.

  16. #16
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,801
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    An understanding of graphics principles may help here ( as anywhere else).

    WHY you want the size reduction is obvious, but why do you need lossless for the web? Are you posting files for the user to print and enlarge in hi-res ( this is generally a bad idea in EVERY SENSE). However you could solve this by using linked thumbnails, that is your page shows reduced, and compressed images, but the link is to the HR version.

    Going back to JPEG format which is, by definition, LOSSY. It utilizes a grid system of 256 'patterns' ( these are the artifacts you start to notice when you over compress)
    to which it tries to find a close match to the pixel arrangements in your image. Ironically, the larger the image the less noticeable these patterns are and the %wise compression you gain. Also because of this limited pattern method compression has what I call 'quantum quality nodes' depending on the dimension of your image and selected quality %)

    This is what I mean:

    An image that has dimensions that are multiples of 16px fares better quality wise that ones that do not, regardless of the compression level
    You can observe this in PS's 'save for web' best, as it tells you what the final file size will be, but you only compress well w/o significant loss of quality at specific nodes ( I believe they are around 8/10% intervals.. but am not sure ). Example a 1MB uncompressed image, may reduce to 400bk at 95%(initial comp), 250kb at 85%, but 246KB at (78%) with significantly more quality loss than 85%, while 75% might give you a 200kb size with nearly the same quality as the 78% image. THESE #s are for the sake of explaining what i meant by QUANTUM QUALITY NODES only.

    PNG-24is a lossless HQ format. I think of it as TIFFs for the web, ) But just like tiffs file size is always much bigger. However, it was mentioned before that metadata, now often included in all image files , does tend to bloat file sizes. Which made think...

    There are utilities out there (png as PNGcrush) which can remove not only the meta data from your PNG24 but the alpha channel ( which you probably don't need, if you were saving as jpg before) I will post again if any other such utilities come to mind.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •