IrfanView/batch processing

From DPWiki
Jump to navigation Jump to search

Many content providers use IrfanView's batch conversion feature to prepare png page scans for proofreading at DP. This feature allows you to make the same change(s) to a large number of images at once, rather than one at a time on each image.

It's often a good idea to start out by selecting a single representative image and manipulating it manually (using the options in the Image menu) rather than through the batch conversion option, particularly if you're new to image processing. By working with a single image you can use Undo and play around with different options in order to determine what sort of processing your images will need. That way you'll know what settings you'll need to choose when converting all the images, so that you don't get to the end of processing 500 images only to find that you should have done something differently near the beginning.

You should save the new images in a different folder so that you have the originals to go back to if something goes wrong.

The Batch Conversion Dialog Box

Select File > Batch Conversion/Rename to open the dialog box. Work through the dialog setting the various options:

  • In the top right area, navigate to the folder where the images are stored on your computer
  • Click Add all at the left, or select which images you want to process and click Add to only add those. Your selected images will be listed at the left in the Input files section.
  • In the Output Directory option (near the middle of the dialog box), click on Browse and choose the folder where you want to save the new images.
  • For the next item down, called Work as, choose Batch conversion. If you wanted to rename the images see Batch Rename below.
  • Under Batch conversion settings, choose an output format of png.
  • Click on Options and select 9 for the Compression level, if it's not already selected.
  • Check the Use advanced options box and click on Set advanced options. Select what operation(s) you want to perform on the images. See Advanced Options below for details.
  • Click on Start in the upper left. Wait until it's finished converting all of them.

Advanced Options

The specific processing needed can vary depending on the quality of the scans, but the following steps will work for most books. Make sure that you've only checked the boxes for the steps that you want to perform. The dialog box will pop up with the settings that you last used, so for instance if you last resized the images and now you're converting to black & white, be sure to uncheck the Resize box.

grayscale and resize

  • Convert to greyscale: This is a checkbox at the right. You'll eventually want black & white, but you should resize the images first before doing that. In the meantime using grayscale will give smaller files sizes for the intermediate steps.
  • Resize: This is a checkbox at the left. Once you've checked it a variety of other options become available.
    • You can resize in different ways, but one way is to choose Set short side to N pixels. Usual values for N would be in the range of 1000-1500, though occasionally larger might be needed for large pages with small text.
    • Be sure to check Preserve aspect ratio!

color adjustment

Often this isn't needed, but if you find that the skipping this step produces images that are too light or too dark then you might need to use these options. Gamma correction is usually the most effective way to adjust that.

As mentioned above it's usually best to select a representative image and adjust the colors on it (under Image > Enhance colors) before doing the batch. Try different settings until you find a combination that gives a good result, and note what numbers you used. Then go back to the batch conversion option and do the same to all the images.

  • Brightness: 0 represents no change. Higher numbers will brighten everything in the image, while lower (i.e., negative) numbers will darken everything.
  • Contrast: 0 represents no change. If you increase this you'll lighten the lighter grays and darken the darker grays.
  • Gamma correction: 1.0 represents no change. Increasing this will lighten the grays, and decreasing it will darken the grays in the image.

black & white

  • Check "Change Color Depth" in the lower left, and select "2 Colors".

change processing order

If you use advanced options to enhance colors, brightness and/or gamma correction, you will probably need to change the processing order. Tick the box next to Custom processing order and the box to the right will display. Click on the box change order and move the options up and down, according to the order in which you processed your test pages. "Change color depth" should be placed last.

Checking the Results

  • Open up the first image and go through them using Page Down to check the results.
    • If you have consistent problems you may want to redo the batch. If just a few images have problems it might be better to process those images manually.
    • Sometimes blank pages may become black instead of white. Use Image > Negative to reverse the colors, then save the new image.
  • Open the folder where the final images are saved. Sort by file size with the largest at the top and check that they're reasonable. Most black & white pngs will end up around 40-60 kB; anything over 100 kB probably indicates a problem. Look at the image to figure out why it's so large.

Batch Rename

This option allows you to rename the files. You can do this at the same time as making other changes by choosing Batch conversion - Rename result files or rename them without doing any other image processing by selecting Batch rename. The files will be renamed in the order that they appear in the Input files list at the left, so make sure that they're in the proper order. You can rearrange the order automatically using the Sort files button at the left or by selecting individual files and clicking Move up or Move down.

Most PMs at DP use 3-digit file names; to do this put ### into the Name pattern box in the lower right of the Batch Conversion dialog box. You can select 4-digit file names by putting #### instead. You can also put any additional letters or numbers before or after that, such as p### to produce p001, p002, p003, etc.

Many other options are available by clicking Set rename options. Use the Help button to find out about other codes you can use to create particular file names.