Jump to content

Image Optimization


sobrenome

Recommended Posts

Posted

ImageMagick is an option you can use (if your host supports it) to process uploaded images, instead of using the built in GD libraries.  It is not specifically there to optimize images, although you have some level of control over how optimized the images it processes are.

Posted

I'm not aware of ImageMagick offering any methods for "optimizing" images outside of maybe stripping metadata, but that depends on your definition of optimization.

Edit: Actually, not even ImageMagick can strip exif metadata without recompressing (reducing the quality of) images. (Which is still fine and slightly beneficial for resized avatars and attachment preview images.)

Stripping exif metadata provides a mostly negligible benefit anyways however, as metadata rarely takes up much space in an image file. There are also situations (particularly in regards to galleries on professional photography websites) where you do not want to strip exif metadata from images, as it can contain information of relative importance.

For lossless PNG images, there are tools like OptiPNG, which can provide a much more significant decrease in file size. However, tools like this have the potential be very resource intensive, especially with larger images, so trying to run them on upload would generally not be a good idea. (Not to mention you'll pretty much never find support for tools like these on shared hosts anyways)

In the past I have set up scripts like this and jpegoptim (which basically just strips all metadata from jpeg images) to run on cron and optimize all uploaded images on my forum, but besides metadata stripping I would avoid trying to run any type of optimization utility on the fly for performance reasons. I wouldn't even bother trying utilizing third parties like the one you are referencing.

Services such as Google PageSpeed do offer some image optimization tools that work in the background as these files are requested (not uploaded), and this would be worth looking into if you're interested in that.

  • 11 months later...
Posted
On 2/11/2015 at 0:26 PM, Makoto said:

I'm not aware of ImageMagick offering any methods for "optimizing" images outside of maybe stripping metadata, but that depends on your definition of optimization.

Edit: Actually, not even ImageMagick can strip exif metadata without recompressing (reducing the quality of) images. (Which is still fine and slightly beneficial for resized avatars and attachment preview images.)

Stripping exif metadata provides a mostly negligible benefit anyways however, as metadata rarely takes up much space in an image file. There are also situations (particularly in regards to galleries on professional photography websites) where you do not want to strip exif metadata from images, as it can contain information of relative importance.

For lossless PNG images, there are tools like OptiPNG, which can provide a much more significant decrease in file size. However, tools like this have the potential be very resource intensive, especially with larger images, so trying to run them on upload would generally not be a good idea. (Not to mention you'll pretty much never find support for tools like these on shared hosts anyways)

In the past I have set up scripts like this and jpegoptim (which basically just strips all metadata from jpeg images) to run on cron and optimize all uploaded images on my forum, but besides metadata stripping I would avoid trying to run any type of optimization utility on the fly for performance reasons. I wouldn't even bother trying utilizing third parties like the one you are referencing.

Services such as Google PageSpeed do offer some image optimization tools that work in the background as these files are requested (not uploaded), and this would be worth looking into if you're interested in that.

I am interested in your OptiPNG and Jpeg scripts for Cron if you're willing to share. I don't want to strip the meta data, I'm looking for compression and max image size to reduce overall file size.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...