Simple command-line utility which appends dimensions to image and video file names. Available for Windows, Mac and Linux. Totally free for personal and commercial use.

  • DSC_0139_3.JPG
  • logo.png
  • arrow_up.gif
  • wallpaper.bmp
  • website_project.psd
  • movie.mp4
  • DSC_0139_3_3264x2448.JPG
  • logo_300x40.png
  • arrow_up_24x24.gif
  • wallpaper_1366x768.bmp
  • website_project_1920x3840.psd
  • movie_1920x1080.mp4

imgdim animation

Installation

Registration is required in order to download and use imgdim. Follow these easy steps:

  1. Head to register page and create your account.
  2. Check your e-mail and click account activation link.
  3. Log in with your username and password.
  4. After logging in, head to download page to download your imgdim version.
  5. Place imgdim executable inside any folder present in your $PATH - https://en.wikipedia.org/wiki/PATH_(variable).
  6. Link imgdim installation to your account - run following command: imgdim link PASSWORD_TO_YOUR_ACCOUNT

Usage

List command

list command (shorthand ls) displays dimensions for supported files inside current directory by default:

[email protected]:~/images# imgdim list
[2018-05-02 20:26:02] INFO  [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=list
[2018-05-02 20:26:02] INFO  [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample_640x480.gif command=list

Files without proper extensions are also detected:

[email protected]:~/imageswoextension# ls
sample1  sample2
[email protected]:~/imageswoextension# imgdim list
[2018-05-02 20:26:02] INFO  [sample1] width=640 height=480 path=/root/imageswoextension/sample1 new_path=/root/imageswoextension/sample1_640x480 command=list
[2018-05-02 20:26:02] INFO  [sample2] width=640 height=480 path=/root/imageswoextension/sample2 new_path=/root/imageswoextension/sample2_640x480 command=list

Sub-directories are not processed by default but you can pass --recursive option (shorthand -r) to change that:

r[email protected]:~/images# imgdim list --recursive
[2018-05-02 20:26:02] INFO  [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=list
[2018-05-02 20:26:02] INFO  [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample_640x480.gif command=list
[2018-05-02 20:26:02] INFO  [sample.psd] width=640 height=480 path=/root/images/website/sample.psd new_path=/root/images/website/sample_640x480.psd command=list

You can also pass list of directories or files to process as arguments:

[email protected]:~/images# imgdim list sample.bmp /some/other/dir
[2018-05-02 20:26:02] INFO  [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=list
...

You may find --json option (shorthand -j) convenient if you would like to machine-process program output:

[email protected]:~/images# imgdim list --json sample.bmp
{"command":"list","height":480,"level":"info","msg":"[sample.bmp]","new_path":"/root/images/sample_640x480.bmp","path":"/root/images/sample.bmp","time":"2018-05-03T16:39:00Z","width":640}

--json and --recursive options can be also used with move and copy commands.

Move command

move command (shorthand mv) will be probably most frequently used one. It actually renames the files by appending dimensions:

[email protected]:~/images# ls
sample.bmp  sample.gif
[email protected]:~/images# imgdim move
[2018-05-02 20:26:02] INFO  [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=move
[2018-05-02 20:26:02] INFO  [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample_640x480.gif command=move
[email protected]:~/images# ls
sample_640x480.bmp  sample_640x480.gif

You can customize how new filename will look like with --template option (shorthand -t):

[email protected]:~/images# imgdim move --template "{name}-{width}-{height}{extension}"
[2018-05-02 20:26:02] INFO  [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample-640-480.bmp command=move
[2018-05-02 20:26:02] INFO  [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample-640-480.gif command=move
[email protected]:~/images# ls
sample-640-480.bmp  sample-640-480.gif

Copy command

copy command (shorthand cp) works similar to move command but it creates copies with dimensions appended so source files are not deleted:

[email protected]:~/images# ls
sample.bmp  sample.gif
[email protected]:~/images# imgdim copy
[2018-05-02 20:26:02] INFO  [sample.bmp] width=640 height=480 path=/root/images/sample.bmp new_path=/root/images/sample_640x480.bmp command=copy
[2018-05-02 20:26:02] INFO  [sample.gif] width=640 height=480 path=/root/images/sample.gif new_path=/root/images/sample_640x480.gif command=copy
[email protected]:~/images# ls
sample.bmp  sample_640x480.bmp  sample.gif  sample_640x480.gif

Link command

link command (shorthand ln) links imgdim installation to your account:

[email protected]:~/images# imgdim link PASSWORD_TO_YOUR_ACCOUNT
[2018-05-02 20:26:02] INFO  [installation linked successfully]

If your password contains spaces, surround it with double quotes.

Install & uninstall command (Windows-only)

context menu

If you are using Windows operating system you may add imgdim shortcuts to right-click context menu.  Just run imgdim.exe install (shortcut in) and interactive installer will let you pick which shortcuts to add.  To uninstall installed shortcuts run imgdim.exe uninstall (shortcut un).

Supported formats

Format Extension MIME
Joint Photographic Experts Group jpg image/jpeg
Portable Network Graphics png image/png
Graphics Interchange Format gif image/gif
Bitmap Image File bmp image/bmp
Tagged Image File Format tif image/tiff
WebP webp image/webp
Photoshop Document psd image/vnd.adobe.photoshop

Range of supported video formats depends on the type of third-party executable installed.

Detecting video dimensions

imgdim alone cannot detect video files dimensions (yet).  It requires one of the following executables installed and available in $PATH:

Executable Website
ffprobe https://www.ffmpeg.org/download.html
mediainfo https://mediaarea.net/pl/MediaInfo/Download
exiftool https://www.sno.phy.queensu.ca/~phil/exiftool/

All above tools are free. Please refer to linked websites for installation instructions for your operating system.