Install the complete package with local command reference and every published mode.
install imgimgInspect images and batch-change the size, format and quality of JPEG, PNG and WebP files.
For image batches, test the transform on one file first, then apply the same resize, format and quality rules to a directory or list.
img <file> [options] · img -f [dir] [mask] [options] · img [options] < <list>img <file>show image information
-s <size>resize proportionally; one number limits the longest side
-s <size> -w | -hresize proportionally by the selected width or height
-s <WxH>resize to exact dimensions
-t <format>convert to a web format: jpg|png|webp
-q <1..100>set output quality; default 85
-o <dst>write one transformed image to an explicit destination
-rreplace the source image after a successful transform
-f [dir] [mask]transform matching images in a directory; current directory and * are defaults
< <list>transform image paths listed one per line in a text file
With the current core, a successfully opened file is immediately available as $. If this module is the highest-priority installed handler for the file extension, typing the filename by itself opens it through this command. These are core conveniences;
By default a transform writes a sibling name.
Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.
Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.
Base and Minimum are two packages of the same current module release, not separate command versions.
Install the complete package with local command reference and every published mode.
install imgInstall the reduced package. Local reference is omitted;
install img -mInstall exactly this published version.
install img -v 1.1.4Ask upgrade to check compatibility and replace the installed block only when needed.
upgrade imgRemove the extension block while leaving the core and unrelated modules intact.
install img -uExamples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.
cd \sandbox\images | img photo.jpgFormat JPEG
Dimensions 48x32
MIME image/jpeg
Size 732 Bphoto.jpgFormat JPEG
Dimensions 48x32
MIME image/jpeg
Size 732 Bimg $ -s 1200 -t webp -q 82photo.jpg > photo.img.webpimg photo.jpg -s 32 -w -o photo-thumb.jpgphoto.jpg > photo-thumb.jpgimg -f \sandbox\images "*.jpg" -s 1200 -t webpphoto.jpg > photo.img.webpimg -s 1200 < \sandbox\images\images.txtphoto.jpg > photo.img.jpg
product.jpg > product.img.jpgimg photo.jpg -s 40 -rphoto.jpg > photo.jpgimg \sandbox\images\missing.jpgFile not foundsandbox/images/photo.jpgThe example uses a file or directory from the protected /sandbox/ documentation workspace.
[binary file: photo.jpg]Adds scalar longest-side resize, explicit width/height proportional modes, exact WxH sizing and compact source-to-result output.