Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!

Image Optimization

For most websites, up to half (50%) of the page weight comes from images (1,000 kb on average).

Here are some of the most common mistakes with images that slow down your site:

THT provides a command that makes it easy to avoid the biggest mistakes.

Size cuts are often around 60% to 70% with usually no perceptible difference in quality.

Running the Command 

On the command line, cd to your document root, then run:

$ tht images

You will see something like this:

Optimize (17) images under:

The original images will be backed up to sub-folders
  named `_originals`

Continue? (y/N)

You can also target a specific directory:

$ tht images /my/website/public/photos

What It Does 

For each image that hasn’t been previously processed:

CAUTIONThe file extension of optimized files are kept as-is, even if the internal image type was changed. This means that you don’t need to update image URLs in your app. However, if you need to update an image later, you will probably need to work with the copy in the _originals subfolder and re-optimize it.

Supported Types 

Source images are limited to the following:

These are determined by the baseline installation of PHP's GD library.



Some possible future enhancements:

See Also