Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dandrayne 1138 posts 2262 karma points
    Jan 28, 2010 @ 15:57
    dandrayne
    0

    Image Filesizes when compression is set to 100

    I think I broke the forum xslt with my previous title (sorry), hope this gets through!

    Hi Doug, hope you are well!  Now, down to business ;-)

    As you know, I consider imagegen to be pretty much essential - clients can't be trusted to properly resize their images!

    We usually only use the most basic aspect of imageGen - resizing.  Often the images are already optimised so we tend not to want any compression.

    When using compression=100 we've noticed that the filesize of the images increases considerably over the original image.  A quick example is as follows (none of the following images are being resized):

    http://www.geckonewmedia.com/media/12265/homepage_banner.jpg
    original, 64.71 kB (66,267 bytes)

    http://www.geckonewmedia.com/umbraco/imagegen.ashx?image=/media/12265/homepage_banner.jpg&compression=100
    140.44 kB (143,806 bytes)

    http://www.geckonewmedia.com/umbraco/imagegen.ashx?image=/media/12265/homepage_banner.jpg
    53.28 kB (54,560 bytes) (default compression, which I take to be 80)

    Basically what I am asking is:  is there a way to retain as close as possible the quality of the original image whilst not increasing filesize? 

    I realise that photoshop is going to have a more proficient and dedicated compression algorithm and this is probably an unfair comparison, but is there anything that can be done to tackle the issue of filesizes and "full quality" images in imageGen?

    Cheers,
    Dan

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 28, 2010 @ 21:50
    Douglas Robar
    0

    I'm going to try to re-post Dan's question, hoping to avoid the xslt parsing error. Doug.

     

    By dandrayne

    Hi Doug, hope you are well!  Now, down to business ;-)

    As you know, I consider imagegen to be pretty much essential - clients can't be trusted to properly resize their images!

    We usually only use the most basic aspect of imageGen - resizing.  Often the images are already optimised so we tend not to want any compression.

    When using compression=100 we've noticed that the filesize of the images increases considerably over the original image.  A quick example is as follows (none of the following images are being resized):

    http://www.geckonewmedia.com/media/12265/homepage_banner.jpg
    original, 64.71 kB (66,267 bytes)

    http://www.geckonewmedia.com/umbraco/imagegen.ashx ? image=/media/12265/homepage_banner.jpg & compression=100
    140.44 kB (143,806 bytes)

    http://www.geckonewmedia.com/umbraco/imagegen.ashx ? image=/media/12265/homepage_banner.jpg
    53.28 kB (54,560 bytes) (default compression, which I take to be 80)

    Basically what I am asking is:  is there a way to retain as close as possible the quality of the original image whilst not increasing filesize? 

    I realise that photoshop is going to have a more proficient and dedicated compression algorithm and this is probably an unfair comparison, but is there anything that can be done to tackle the issue of filesizes and "full quality" images in imageGen?

    Cheers,
    Dan

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 28, 2010 @ 21:58
    Douglas Robar
    0

    No, that didn't work either.

    Okay, here's the answer for when the xslt macro gets fixed...

     

    ImageGen should simply send out the original file if there is nothing to be done. That is, no resizing, no borders, no changing the output format, nothing. But that doesn't really happen in the real world. You're using ImageGen for a reason!

    You could always check the image's width and height in your macro and not involve ImageGen at all in those rare cases, which would get certainly ensure the original file was returned unprocessed.

    Any time you re-process a processed image (especially jpgs) you'll end up with two results... a loss of quality and a larger file size. This is why you only ever save the final output to jpg when working in photoshop, for instance. Even in photoshop, opening a high quality jpg and saving it at maximum quality ten times in a row will make the situation obvious... less quality and larger files. That's just the nature of jpgs.

    Of course, this is not so evident when you're shrinking an image and saving it to jpg just once. That's when you start to play with the compression to get the best trade-off between filesize and quality.

    So, while the issue is ImageGen related the core issue is jpg and not ImageGen per se.

    Make sense?

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft