I've an inefficient workflow by which I generate responsive images. What I'll do is (1) Install a dummy Wordpress, (2) When I want to include an image in my website, upload the original image to the dummy site Media Library (usually a 6200x4100 or so very large image), (3) Open up chrome copy the tag including the srcset, (4) Make a list of the all the files in srcset and save it to a text file, (5) xargs -n 1 curl -O < download.txt, (6) Paste the copied tag into my site's html, (7) Edit the tags to remove the dummy site's URL. (Also, I usually run the files through ImageOptim one last time to reduce the file sizes a little bit more too.)
This seems like a convoluted process, but still yet better than doing each one by hand though. Yet, there has got to be a more efficient way to automate this, correct?
<img width="1568" height="1045"
src="img/some_image-1568x1045.jpg" alt=""
srcset="img/some_image-300x200.jpg 300w,
img/some_image-768x512.jpg 768w,
img/some_image-1024x683.jpg 1024w,
img/some_image-1536x1024.jpg 1536w,
img/some_image-1568x1045.jpg 1568w,
img/some_image-2048x1365.jpg 2048w"
sizes="(max-width: 1568px) 100vw, 1568px">
I'm looking to generate the above code automatically, but more importantly generate the actual images automatically from the command line, but unsure how to do so and unfamiliar and unable to find any tools that already exist for this purpose.