These days, image editors are a dime a dozen. Beyond new filters, few tools offer exciting features. What if you could integrate image editing directly into your batch jobs or Windows scripts?
If you’re familiar with IrfanView and think it’s only a simple image viewer and screenshot app, then we invite you to take another look. You can run all the script commands presented below from the command prompt or Windows Terminal, so long as you are working from the IrfanView directory. Let’s see how it’s done.
Before you run commands, let’s get a few basics out of the way. First, install or update IrfanView. We recommend installing the latest 64-bit version of IrfanView.
How to Find Your IrfanView Directory
To run commands, you’ll need to know IrfanView’s directory.
To find the directory, use an IrfanView shortcut or pin the program to the Windows taskbar. Right-click taskbar icon > IrfanView shortcut, select Properties, and check what it says under Target. In Windows 11, you should find the 64-bit version of IrfanView in the C:Program FilesIrfanView directory.
How to add the IrfanView Directory to Your System Path Variables
If you don’t want to navigate to the IrfanView directory every time you run an IrfanView command, you could also add the directory to your System Path variables. That way, the “i_view64.exe” will be recognized universally.
- Press Windows + S, enter Advanced system settings, and open the respective result.
- In the Advanced tab of the System Properties window, click the Environment Variables… button in the bottom right.
- Under User variables (applies to your user only) or System variables (applies to all users), click Path > Edit.
- In the Edit environment variable window, click New, enter your IrfanView directory, then click OK.
Now, the commands below should work from any command prompt location.
Running IrfanView Commands
You can find a long list of script commands from within the IrfanView application under Help > IrfanView Help > Overview > Command Line Options.
Here, we’ll highlight 10 of the most powerful and useful commands. You can issue these from the Windows Terminal or command prompt, or from within a Windows Script or Batch file.
Create an Instant Slideshow
This command creates an instant slideshow. You can use pictures stored in a directory, or replace “c:images” with “c:images.txt” to use a text file instead. Each line of the text file needs to contain the full path or the path relative to your IrfanView executable.
When you run the command, the pictures will show up in the center of your screen on a black background. Add the /closeslideshow parameter at the end of your code to close the slideshow automatically after the last picture.
The nice thing about being able to launch a slideshow with one command line is that you can display your slideshow instantly without any work. Just type the command and start scrolling!
Look at All Images in a Directory
i_view64.exe c:temptestpics /thumbs
This command offers a fast way to take a look at all images within a directory without the need to open up every one of them. It will launch IrfanView in thumbnail mode, defaulting to the directory that you’ve defined.
Resize Lots of Images at Once
i_view64.exe c:temptestpics*.jpg /resize=(200,100) /aspectratio /resample /convert=c:temptestpicsthumbnails*.png
Resizing a large collection of images can be annoying and time-consuming. With a suitable command, however, you can be done in seconds.
Let’s break down the example above. The first part defines your source directory and image type. Then you define the resize parameters. The last part of the command will convert the output images to any format. In seconds, all images are done.
Send Image Collections to the Printer
i_view64.exe c:testpics*.jpg /print
Want to send a collection of images to your default printer? Just issue the print command. As with previous examples, you can replace the directory with a text file that contains the list of images to print.
Take Instant Screenshots With a File Timestamp
i_view64.exe /capture=0 /convert=c:tempcapture_$U(%d%m%Y_%H%M%S).jpg
With this command, you can take an instant screenshot and save it as a file with a time stamp.
The capture=0 could be 1 (current monitor), 2 (foreground window), 3 (client area), 4 (rectangle section), 5 (launch in capture mode), 6 (start in capture mode), or 7 (fixed rectangle).
Once the full screenshot is saved to file, you can email it or process it using other Windows Scripting or Batch commands. The potential of this command is pretty powerful.
Note that nothing actually happens or opens on your screen when you run this command, but you’ll find the screenshot in its target directory.
Search for Images Quickly on Your Computer
i_view64.exe c:temptestpics /thumbs /filepattern="*.png"
This is a fast and easy way to search for images on your computer. It will open IrfanView in thumbnail mode, using the file pattern that you defined.
Deny User Permissions
i_view64.exe c:test.jpg /hide=7
Let’s say that you’re writing a Windows Script and you want to display a picture to the user, but you don’t want to let them modify or change the file. The command above can accomplish that.
The “hide” value is a combination of what parts of the window you want to hide. Just choose 1 (toolbar), 2 (status bar), 4 (menu bar), or 8 (caption). To combine multiple parts of the window, just add the numbers together!
Be careful about using 15 because if you hide everything, the user will have no way of ever closing the window at all.
Output Image Files to a TIF File
i_view64.exe c:test.jpg /append=c:test.tif
Some other wonderfully useful commands include outputting image files to a TIF file.
Create a Panorama Image
IrfanView also lets you create a panorama image from multiple images. 1 is horizontal and 2 is vertical, followed by the files you’d like to combine. You can also refer to a text file using “filelist=c.mypics.txt” instead of the list of images. Note that IrfanView only stores the file in the Clipboard, meaning you’ll have to save it manually.
Set an Image as Desktop Wallpaper
i_view64.exe c:test.jpg /wall=0
This command sets an image as the computer desktop wallpaper background. Set wall equal to 0 for a centered image, 1 to tile it, 2 to stretch it, and 3 to resize the image proportionally.
Using this command, you can set the background image on your PC much faster than the number of clicks it takes to do it otherwise.
That’s the beauty of the set of command tools you get through IrfanView; you can process and manipulate images on your PC much faster and more efficiently than would ever be possible using the old point and click approach.
Power Up Your IrfanView Image Viewer
IrfanView is an underestimated image viewer and editor. Give a few of the commands above a try, and see if they help you save a little time. As mentioned above, you can find more commands and examples in the tool itself under Help > IrfanView Help > Overview > Command Line Options.
Image credits: Kakao Por