DEV Community

Cover image for Using jpegoptim to optimize JPEG images
Onelinerhub
Onelinerhub

Posted on

4 1

Using jpegoptim to optimize JPEG images

1. Batch optimize multiple JPG images

jpegoptim --strip-all /dir/*.jpg
Enter fullscreen mode Exit fullscreen mode
  • jpegoptim - tool to optimize JPG images (apt install jpegoptim),
  • --strip-all - removes all meta data from file,
  • /dir/*.jpg - list of images to optimize (files will be overwritten).

Open original or edit on Github.

2. Optimize JPG image

jpegoptim --strip-all img.jpg
Enter fullscreen mode Exit fullscreen mode
  • jpegoptim - tool to optimize JPG images (apt install jpegoptim),
  • --strip-all - removes all meta data from file,
  • img.jpg - input image to be optimized (will be overwritten).

Open original or edit on Github.

3. Optimize JPG image to fit to certain file size

jpegoptim --strip-all -S 100k img.jpg
Enter fullscreen mode Exit fullscreen mode
  • jpegoptim - tool to optimize JPG images (apt install jpegoptim),
  • --strip-all - removes all meta data from file,
  • -S 100k - try to optimize so that final file size is less than 100k,
  • img.jpg - input image to be optimized (will be overwritten).

Open original or edit on Github.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)