Batch Automation Help Needed!

Discussion in 'Photoshop Tutorials' started by Mayor Tommy, Jul 11, 2003.

  1. Mayor Tommy

    Mayor Tommy Guest

    i've torn out half my hair trying to get a batch automation action to work,
    no luck, i come to you on my knees bloodied and beaten looking for help.
    I've recorded an action that I want to apply to folders of images - the
    action is simple, just resizes, desaturates and saves as a jpeg. The problem
    is I am using the 'Save For Web' to compress the thumbnails. When I run the
    action in batch automation mode, at the end of every process done on a photo
    I get the pop up window in 'Save For Web' screen asking me to type in the
    name I want to save the file as. This defeats half the purpose, i want the
    whole thing automated including saving and naming the files. IF...........IF
    I use 'Save As' versus 'Save for Web' in the action, it works. But the
    thumbnails are WAY bigger(18KB versus 5-6KB) using 'Save As' at the same
    compression setting. Why would there be such a big difference between the
    two methods of compressing a jpeg?

    So can anyboy tell me if there is a way with PS 6 to do a batch action using
    'Save for Web' without me having to manually typing the name of each file

    Mayor Tommy, Jul 11, 2003
    1. Advertisements

  2. Mayor Tommy

    Tom Thackrey Guest

    make sure your save as has the ICC Profile box unchecked and the preview in
    the jpeg options unchecked.
    Tom Thackrey, Jul 11, 2003
    1. Advertisements

  3. Mayor Tommy

    Mayor Tommy Guest

    i'm assuming these two things will cut down on the size of the jpeg images
    using 'Save As', thanks.
    I'll try it and see how much smaller the file sizes are. But I'm still
    wanting to know if it's possible to use a batch action utilizing 'Save For
    Web' without having the box pop up asking me to type in the name of the file
    i'm compressing and saving.
    Mayor Tommy, Jul 12, 2003
  4. Mayor Tommy

    Warren Sarle Guest

    Yes, it's possible. The general procedure is to open an image and go through
    "Save for Web", setting every option to a value you do NOT want to use in
    the action. Of course, save it to some temporary or junk folder. Then create
    a new action and go through "Save for Web" again, setting EVERY option
    to the values you really want to use.

    When you run File->Automate->Batch, be sure you check the 'Override
    Action "Save As" Commands" box. I've run this several times without
    getting any dialog boxes.
    Warren Sarle, Jul 12, 2003
  5. Mr. Mayor,

    Photoshop is great for what it does, but it doesn't do everything well. If there
    is a tiny bit of hacker in you, I may have a good solution.

    Image Magick is a very slick tool and you can actually get it to do most of what
    Photoshop does and much of what it doesn't do. I wrote a Perl which I use for
    every photo shoot to UPDateJPGs. You will need to install Perl and the Image
    Magick module (very easy) and find a True Type Font to use the CopyRight option.

    Surf to and
    download windoze MSI package. It will install Perl and give you the correct file
    associations, etc. Then download the Perl Magick zip file from , unzip it and install it. There may be
    a newer version on, but this is the one I have installed
    and I know it works.

    If you are not running windoze, you will need to download and compile the
    source. The script should still work.

    Then find some True Type Font like timesi.ttf and put it in $ttfont =
    "c:/wp/timesi.ttf"; (or hack your own path) if you want to copyright your

    Download the Update JPG Perl script, remove the ".zip" from the file name (it's
    a flat ASCII Perl script) and put in your bin directory (somewhere in your path) .

    I just tried desaturating images and it worked. Try this to process images in
    the PWD (. -> dot), resize to 800 pixels on the long side (and keep same aspect
    ratio), output the desaturated files to the "desat" subdirectory, set saturation
    to 40% of the original and use 70% JPG quality:

    cd <my_image_directory> <enter>
    mkdir desat <enter>
    PWD SIZE OUTPUT_DIR sAturation_% JPG_Quality . -s 800 -o desat -a 40 -Q
    70 <enter>

    The "." reads images from the PresentWorkingDirectory (PWD).
    The -S (Size of longer side) sets output resolution in pixels. Adjusts other
    side automatically.
    The -O (Output_Dir) determines where the desaturated files go. DON'T USE "."
    (DOT, ->PWD)! Clobbers!
    The -A sets the sAturation. 100 does nothing, 50 decreases by 50%, 150 increases
    by 50%, ...
    The -Q sets the JPG compression quality. 100 is HUGE. 10 looks crappy.Adjust to
    get the right file size.

    If you have ever installed anything in windoze, this should take no more than 10
    minutes. Look at the perl.html documentation, possibly installed in ~~
    C:\Program Files\ImageMagick-5.5.3-Q16\www\perl.html

    BACK IF NOT SATISFIED (AND IT'S FREE)! Script licensed under GPL, just like

    If you have any updates to the script, please post them so I can priate them!



    P.S. And, you may wish to hack the $copyright variable unless you want to give
    me credit for your pictures.

    Here's the usage:
    USAGE: [-cdehlnyz] [file_mask ...] [-s xres [yres]]
    [-a sAturation] [-o outdir] [-p param_file] [-t [size]] [dir1 ...]
    [file1 ...] [-q compression_quality] [-R Rotation_Angle (see note)] <enter>
    -A - sAturate. Requires integer % arg. 100 -> neutral, 150 increases
    saturation by 50%, 50 reduces saturation by 50%.
    -C - CopyRight Prints Copyright 2003 Brian P. Barnes in black and then white
    on the lower left hand corner of the picture. See notes below.
    -D - DEBUG Prints mountains of useless trivia to STDERR as program runs.
    -E - Equalize. Perform histogram equalization to the image.
    -H - HELP! Prints this help info and exits immediately.
    -L - LowCase. Lower case all file names for output files.
    -N - Normalize. Transform image to span the full range of color values.
    -O - Output Specify one directory for all output. Unless specified, the
    output is put in a local subdirectory. See details below.
    -P - Param_file Parameter file specifier. Must be a parameter file. Any
    errors will be handled exactly as on ARGV. Whitespace delimited. Perl
    comments OK. Blank lines OK.
    -Q - Quality. Quality for JPG compression. Range: 1 to 100 (100 = bigest).
    -r - ROTATE. Rotate pictures angle degrees. Positve means Clockwise.
    -S - Size Specify the resultant output size. The default behavior is to
    create output with the correct aspect ratio. If you argue only one
    resolution which is positive, it defaults to the longest dimension and
    the other dimension is calculated to give the correct aspect ratio. If
    only argue one dimension and it is negative, that becomes the absolute
    X resolution regardless of whether the picture is in portrait or
    If you argue both X and Y, the picture will come out with exactly that
    many pixels, but with the orientation chosen to most closely match the
    original. If either or both are negative, the picture will be contorted
    to exactly those dimensions. If no size is specified, the size remains
    unchanged. Specifying a size causes output to go to the absolute value
    of the /$size directory (-s 640 sends output to ./640 directory,
    it if necessary, -s -640 also goes to ./640).
    Note: don't specify an X resolution, leave off they Y resolution and
    specify a numeric directory which may be mistaken as a Y res. <-o-:
    -T - Thumbnail Appends 'tn' to the end of each filename proper (just before
    the dot and extension) and output goes to the local /tn subdirectory.
    dir is created if it doesn't already exist. Resolution is arbitrarily
    to 120 on the long side and is proportional on the shorter size but can
    overriden by arguing an integer after the -T option. If an output
    directory is specified, all output goes there, not to /tn.
    -Y - Young. If the output file is younger than the input file, keep it!
    -Z - ZAP! Nuke any apparent orphan files in the destination directory which
    do not exist in the source directory. This allows you to prune files
    from the source directory and have them disappear from the destination

    If neither file names nor file masks are argued, .jpg is used as the default
    file type. If file names are argued, no default mask will be used.

    Given a directory and an optional filename mask, read matching files, convert
    to JPG, and store in the local /jpg subdirectory unless size is specified in
    which case outuput goes to the /SIZE directory (eg: /640, /800) or unless
    an output directory is explicitly argued.

    Copyright Notice:
    It's the BrianP copyright. It figures out how many pixels tall the picture
    is and places the text a few pixels above the bottom. It requires the Times
    font True Type data file timesi.ttf. It works if you have it in the PWD. I
    found it in an nt service pack backup directory. It first prints in black,
    then moves one pixel each right and up and prints again in white. At least
    one of these should show up and one often shadows the other on intermediate
    lightness colors!

    File Mask:
    The recognized file mask format is a leading dot followed by exactly 3
    letters. (ex: '.tif' or '.gif'). If none are specified, the default is
    arbitrarily chosen as '.tif'. If '.jpg' is chosen and no output directory
    and no X res are specified, instead of potentially clobbering the contents
    of the current directory, output is sent to ./jpg at the same size,
    essentially becomming a file copy. This is useful to insert the copyright

    Output Directory:
    If no output directory is specified, the results are placed in a local
    subdirectory. If no X res is specified, the results are placed in the local
    /jpg directory which is created if it doesn't exist. If an X res is specified,

    that becomes the name of the local output directory, one for each argued input

    directory. If an output directory is specified, it must already exist and all
    output goes there. If multiple input directories are specified and if they
    contain files with the same file name, clobbering will occur so that the
    output of the last input directory will overwrite files of the same name from
    previous input directories. In DEBUG mode, this will generate an overwrite

    Parameter file:
    Enter anything you would enter on the command line into a file with any type
    of whitespace as delimiter. Perl comments and blank lines are encouraged.
    The required argument is a readable file with intelligible contents.
    Actually, since there are no other filename arguments, you don't need the
    '-p' in front of the name.

    Outside tools used:
    ImageMagick Perl module and timesi.ttf font.
    Brian P. Barnes, Jul 15, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.