Batch processing multi-TIFF in Irfan view

batch filecommand lineimagesirfanviewtiff

I have to convert DPI of more than 5k Tiff images on a monthly basis from 200×200 to 100×100. I can do that in Irfan view using a .bat file that i have created.. the following is the .BAT file code

@"c:\program files\irfanview\i_view32.exe"
"e:\batch1*.tif /aspectratio
/resample /tifc=4 /dpi=(100,100)
/convert=e:\batch2*.tif" %*

Where tifc=4 is Fax 4 compression

However, the above code doesn't help me change the DPI for other pages except for Only the first page in the tiff thats getting converted to 100 DPI. Rest all pages are still 200 DPI. I am using WinXP Professional and Irfan View. Can anyone tell me what I am missing.

Best Answer

Convert multiple images per command line

Use nconvert with its infinite possibilities.

NConvert is a batch utility for converting graphic files.

  • Import about 400 graphic file formats
  • Export about 40 graphic file formats
  • Multipage TIFF, Animated GIF, Animated ICO support
  • Resize
  • Adjust brightness, contrast...
  • Modify number of colors
  • Apply filters (blur, average, emboss, ...)
  • Apply effects (lens, wave, ...)
  • And many many other things

Read this User guide for some examples to start.
I uploaded the full help file on pastebin to see what parameters are available

Note: A graphical front-end using nconvert is XnConvert


To answer hemalshah' initial question

  1. download nconvert and place it somewhere
  2. create a .cmd in the same folder and copy&paste the following command
  3. Customize the path to your own .tiff image and execute the batch file.
    This will create a new mysource_1.tiff file in the source folder (use -overwrite to replace the original)

nconvert -out tiff -multi -dpi 100 -c 4 -keepdocsize -keepfiledate mysource.tif

  • this can easily be expanded to convert thousands of files at once.
    Nconvert understands textfiles with image paths as input
  • -out tiff -multi is necessary to tell nconvert to produce multi-page TIFF files
  • -dpi 100 obviously sets the new DPI
  • -keepdocsize preserves your page height and width
  • -keepfiledate preserves the original create date
  • -c 4 sets the compression method. I recommend ZLIB since it produces the smallest files
    Other compression methods

    1 (Rle), 2 (LZW), 3 (LZW+Prediction), 4 (ZLIB)
    5 (CCITT G3), 6 (CCITT G3-2D), 7 (CCITT G4) only B/W
    8 (JPEG) only 24/32 bits
    

I separated the output tiff into single page tiff files to see if all pages are set to 100 DPI. As the screenshot proves, nconvert will solve your issue.

enter image description here

Related Question