That's not really exactly what I want, however. First, I want to be
able to specify the filename and multiplier on the command line.
Second, the output needs a slight tweak to be more useful—the values need
to be surrounded by quotation marks.

That's not too hard to accomplish given the basic script we already have.
See if you can do it yourself.

Tip: I actually use a “for name; do; done” loop to step through the file
scaling, so I can specify a group of images and calculate them all en
masse. Try it, coupled with the shift command, to remove the multiplier
value once it's saved into a named variable.

Dave Taylor is a 26-year veteran of UNIX, creator of The Elm Mail System,
and most recently author of both the best-selling Wicked Cool
Shell
Scripts and Teach Yourself Unix in 24
Hours, among his 16 technical
books. His main Web site is at www.intuitive.com,
and he also offers up tech support at AskDaveTaylor.com. Follow him on Twitter if you'd like:
twitter.com/DaveTaylor.

Dave Taylor has been hacking shell scripts for over thirty years. Really.
He's the author of the popular "Wicked Cool Shell Scripts" and
can be found on Twitter as @DaveTaylor and more generally at
www.DaveTaylorOnline.com.