"ImageResizer" is now "dotnet srcset"

Updating my responsive image CLI to a .NET global tool

A few years ago, I created a CLI tool that helped create responsive image sets for the web. If you're not familiar with the concept, it's an easy way to maximize image quality while minimizing page weight, and you can learn more about it here.

As a good dogfooder, all of the images on this site are created using this project, and now that .NET global tools are all the rage, I've updated (and renamed) this project to use this new technology.

You can install dotnet-srcset with the following command:

dotnet tool install -g srcset

Running it is then as simple as providing a file or directory (with a -r recursive option) and an optional set of widths to resize to:

> srcset blog/images/ -r 100 200 300 img1-0100.jpg img1-0200.jpg img1-0300.jpg img2-0100.jpg img2-0200.jpg img2-0300.jpg

By default, dotnet-srcset will create a set of 10 images, ranging from 240px to 2400px wide.

> srcset test.png test-0240.png test-0320.png test-0480.png test-0640.png test-0800.png test-0960.png test-1200.png test-1600.png test-1920.png test-2400.png

So, since storage is so much cheaper than bandwidth these days, give it a try and save some of those cloud dollars!