Scripting Gallery

Batch Photoshop Gallery Generator

Scripting Gallery

Configuration

Here is the list of all configurable parameters and options of the script (in order of appearance in the script code): whether configurable through the both dialog window and source code or through editing the source code only. They could be divided on several logical groups of settings.

Note: default values of some settings may differ in script version acquired with Sample pack.

Tip: for editing the source code it's recommended to use the text editor with syntax highlighting such as Notepad++ (which I, actually, used to write this script).

Initial directory

  • Path [dialog]

    Defines the working folder.

    "Y:\Your\path"
    Images in specified folder will be processed with the script.

    Default value is matched with the home directory of the script. Can be set through editing the source code where it could be found after settings, that will be considered next.

    Note: Photoshop CS5 has difficulties with exporting images using script to folders, path to which contains cyrillic symbols, so it's better not to have non-latin characters in path to your working directory.

    Specifying initial directory

General settings

  • DontAskMeAnything

    Toggles "silent" mode of the script. While in "silent" mode the only question you'll be asked is the path to working directory.

    [default] false
    "Standard" mode: all input dialogs are active
    true
    "Silent" mode: most of input dialogs are suppressed, except the prompt to input working directory

    Experienced users will find this option very handy: just configure the script in source code once and don't be bothered by any input boxes.

  • SuppressDialogs

    Controls whether the script should suppress native Photoshop warnings (such as Color Profile Mismatch warning) or not.

    [default] false
    All error and warning messages are displayed to user
    true
    All error and warning messages (as well as other Photoshop dialog windows) are suppressed not to bother you
  • b_Folder, s_Folder

    Defines the names of folders in which the output images will be stored.

    For b_Folder:

    [default] "b"
    The folder with this name will be created (if not yet) according to NestedDirs and SaveInOneFolder settings and will contain "big" output images

    For s_Folder:

    [default] "s"
    If WorkMode set to 1 the folder with this name will be created (if not yet) according to NestedDirs and SaveInOneFolder settings and will contain thumbnails
  • WorkMode [dialog]

    Toggles the processing mode of the script: should it create thumbnails or not.

    0
    Do not create thumbnails
    [default] 1
    Create thumbnails

    If set to 0, directory specified in s_Folder variable won't be created and thumbnails won't be generated, only big copies will be put in b_Folder directory.

    Specifying work mode

  • NestedDirs [dialog]

    Controls how script should process files in nested subdirectories inside initial folder.

    false
    Do not process files in subdirectories
    [default] true
    Process files in subdirectories

    If set to true, it will force script recursively dive in each and every nested directory inside initial folder (set on startup) and process every image file found there. Output will be saved in appropriate folders according to SaveInOneFolder setting.

    Processing files in subdirectories

  • SaveInOneFolder

    Controls where script should create output folders with names specified in b_Folder and s_Folder settings. Or, in other words, should it put all output images in one and the same folder or should it create appropriate output subfolders inside every processing directory.

    [default] false
    Output folders will be created inside every processing directory and will contain output images of that directory
    true
    Output folders will be created as child folders of initial directory and will contain output images from every processed directory
  • ExcludeDirsPrefix [dialog]

    Directories which names start with this character sequence won't be processed (even if NestedDirs is set to true).

    [default] "$"
    Folders with names starting with "$" (such as "$dummy_folder", "$_dummy", etc.) won't be processed and images inside this folders won't be accessed by the script

    Excluding subdirectories

"Big" images settings

  • ResizeMode [dialog]

    Specifies how "big" images should be scaled.

    1
    Image will be resized proportionally with its widest dimension (whether width or height) downscaled to size specified in Size setting
    [default] 2
    Image will be resized proportionally with its height downscaled to size specified in Size setting
    3
    Image will be resized proportionally with its width downscaled to size specified in Size setting

    If according source image's dimension lower than Size than resizing won't occur.

    Specifying resize mode

  • Size [dialog]

    Size to which source images will be scaled according to ResizeMode setting.

    [default] 600
    Dimension in pixels

    Specifying size

  • LogoFile [dialog]

    Filename of image (watermark) which should be pasted above the source image (at the position specified in Position setting) while generating "big" output image.

    [default] "logo.png"
    Image with specified filename will be pasted above the source image
    ""
    Nothing will be pasted above the source image

    Logo image should be placed in the home directory of the script. If logo image with specified filename can't be found and DontAskMeAnything is set to false warning message will be popped up and user will be asked to re-enter filename of the logo image.

    Specifying Logo (watermark)

  • Position [dialog]

    Position on the source image at which logo (specified in LogoFile setting) will be pasted while generating "big" output image.

    0
    Center of source image
    1
    Right-bottom corner
    [default] 2
    Left-bottom corner
    3
    Left-top corner
    4
    Right-top corner
    5
    Center-bottom

    If logo image wider than source image and Position is set to 5 (center-bottom) it will be centered horizontally and cropped.

    Specifying Logo position

  • Opacity

    Opacity of the pasted logo.

    [default] 100
    Pasted logo is completely opaque

    Tip: as long as you supply as logo an image with alpha channel you can make it semi-transparent itself with no need to change Opacity setting.

  • oDx, oDy

    Shift of the logo from the source image's bounds.

    For oDx:

    [default] 8
    Horizontal shift in pixels

    For oDy:

    [default] 8
    Vertical shift in pixels

Thumbnail settings

  • ThumbDifferent [dialog]

    Toggles using different sizes for thumbnails based on aspect ratio (AR = height/width) of the source image.

    [default] false
    All thumbnails have the same sizes specified in ThumbWidth and ThumbHeight settings
    true
    Thumbnails of images with AR > 1 have sizes ThumbWidth and ThumbHeight; with AR <= 1 have sizes ThumbWidth_Horiz and ThumbHeight_Horiz

    You may find this setting useful for arranging some sorts of web-gallerie, e.g. certificates or diplomas gallery.

    Specifying thumbnail creation mode

  • ThumbWidth [dialog] , ThumbHeight [dialog]

    Defines the width and height of thumbnails. If ThumbDifferent is set to true - width and heigth of thumbnails of images with AR > 1 only.

    For ThumbWidth:

    [default] 60
    Width of thumbnail in pixels

    Specifying thumbnail width Specifying thumbnail width

    For ThumbHeight:

    [default] 60
    Height of thumbnail in pixels

    Specifying thumbnail height Specifying thumbnail height

  • ThumbWidth_Horiz [dialog] , ThumbHeight_Horiz [dialog]

    Defines the width and height of thumbnails of images with AR <= 1. Works if ThumbDifferent is set to true.

    For ThumbWidth_Horiz:

    [default] 140
    Width of thumbnail in pixels

    Specifying thumbnail width for AR <= 1

    For ThumbHeight_Horiz:

    [default] 60
    Height of thumbnail in pixels

    Specifying thumbnail height for AR <= 1

  • ThumbWideMost

    Defines the way script should cut thumbnails off from the source image.

    false
    Thumbnail will be cut off from the source image preserving the original scale
    [default] true
    The source image will be properly scaled to fit the dimensions of thumbnail

    If set to true, in fact, it is the bounding box of thumbnail that is upscaled to fit the source image, then cropped and downscaled back to desired thumbnail size (specified in ThumbWidth, ThumbHeight, ThumbWidth_Horiz and ThumbHeight_Horiz settings).

  • ThumbScaleFactor [dialog]

    Defines the indent of thumbnail from the edges of bounding box of the source image. Works if ThumbWideMost is set to true.

    [default] 5
    Indent from the edges of the source image in percentage

    This option may be very useful in the case when the source image has the frame (or copyright notice) itself and you don't want the parts of it to be visible on thumbnail.

    Specifying thumbnail indent from edges

  • ThumbDy [dialog]

    Defines the vertical indent of thumbnail from the top edge of image.

    [default] -1
    No vertical indent is applied, thumbnail is cut off from the center of the source image
    xx
    Indent from the top edge of the source image: if ThumbWideMost is set to true - in percentage (of the vertical dimension of image), if ThumbWideMost is set to false - in pixels

    This option may be very useful for portrait photos if you don't want any cut off faces on your thumbnails: just make thumbnails generating from the top of image, not from the center of it.

    Note: if ThumbWideMost is set to true the percentage value of the ThumbDy indent is applied to both source image area and the thumbnail area itself. It means that value of 0 (percent) place the top of the thumbnail's bounding box in the top of source image's bounding box, value of 50 (percent) place the center of the thumbnail's bounding box in the center of source image's bounding box, value of 100 (percent) place the bottom of the thumbnail's bounding box in the bottom of source image's bounding box, etc.

    Specifying thumbnail vertical indent

  • FrameFile [dialog]

    Filename of image which should be pasted above thumbnail (in order to make a frame). If ThumbDifferent is set to true - frame for thumbnails of images with AR > 1 only.

    "frame.png"
    Image with specified filename will be pasted above the thumbnail of source image
    [default] ""
    Nothing will be pasted above the thumbnail

    Frame image should be placed in the home directory of the script. If frame image with specified filename can't be found and DontAskMeAnything is set to false warning message will be popped up and user will be asked to re-enter filename of the frame image.

    Specifying Frame for thumbnails Specifying Frame for thumbnails

  • FrameFile_Horiz [dialog]

    Filename of image which should be pasted above thumbnail of image with AR <= 1. Works if ThumbDifferent is set to true.

    "frame_horiz.png"
    Image with specified filename will be pasted above the thumbnail of source image
    [default] ""
    Nothing will be pasted above the thumbnail

    Frame image should be placed in the home directory of the script. If frame image with specified filename can't be found and DontAskMeAnything is set to false warning message will be popped up and user will be asked to re-enter filename of the frame image.

    Specifying Frame for thumbnails for AR <= 1

Quality settings

  • ResizeInterpolationB, ResizeInterpolationS

    Defines the resampling method used for scaling while generating "big" images (ResizeInterpolationB) and thumbnails (ResizeInterpolationS).

    1
    No resampling
    2
    Nearest Neighbor
    3
    Bilinear
    [default] 4
    Bicubic (default for ResizeInterpolationB)
    [default] 5
    Bicubic Sharper (default for ResizeInterpolationS)
    6
    Bicubic Smoother
  • SharpenB, SharpenS

    Toggles the sharpening of resulting images: "big" ones (SharpenB) and thumbnails (SharpenS).

    false
    Don't apply sharpening
    [default] true
    Apply sharpening using Unsharp Mask Filter (with settings defined in following parameters)
  • SharpenB_USM_Amount,
    SharpenB_USM_Radius,
    SharpenB_USM_Threshold

    Unsharp Mask Filter settings used for sharpening "big" output images while SharpenB is set to true.

    For SharpenB_USM_Amount:

    [default] 30
    Amount, determines "how much to increase the contrast of pixels". Takes values 1-500.

    For SharpenB_USM_Radius:

    [default] 0.5
    Radius, determines "the number of pixels surrounding the edge pixels that affect the sharpening. The greater the radius value, the wider the edge effects. And the wider the edge effects, the more obvious the sharpening." Takes values 0.1-250.0.

    For SharpenB_USM_Threshold:

    [default] 0
    Threshold, determines "how different the sharpened pixels must be from the surrounding area before they are considered edge pixels and sharpened by the filter. For instance, a threshold of 4 affects all pixels that have tonal values that differ by a value of 4 or more, on a scale of 0 to 255. The default Threshold value (0) sharpens all pixels in the image." Takes values 0-255.

    This is the same settings you may find in Unsharp Mask Filter dialog in Photoshop.

  • SharpenS_USM_Amount,
    SharpenS_USM_Radius,
    SharpenS_USM_Threshold

    Unsharp Mask Filter settings used for sharpening thumbnails while SharpenS is set to true.

    For SharpenS_USM_Amount:

    [default] 50
    Amount (for description see previous section).

    For SharpenS_USM_Radius:

    [default] 1.0
    Radius (for description see previous section).

    For SharpenS_USM_Threshold:

    [default] 0
    Threshold (for description see previous section).

    This is the same settings you may find in Unsharp Mask Filter dialog in Photoshop.

Output settings

  • DeleteOriginals

    Controls whether the script should delete the original image file after processing it.

    [default] false
    Don't delete original files
    true
    Delete original file
  • SaveOptimized

    Controls whether the script should optimize output images before saving or not.

    false
    Save without optimization
    [default] true
    Save optimized

    Note: if set to true Photoshop will perform export to JPEG format with quality settings defined in OptimizeQuality parameter.

  • OptimizeQuality

    Defines the quality the output images will be saved with. Works if SaveOptimized is set to true.

    [default] 55
    Number in range 1 (lowest quality, smaller size) to 100 (highest quality, bigger size)

    Note: that is the same quality setting you can find in Photoshop's "Save for Web & Devices..." dialog.

  • LowerCase

    Controls whether the script should convert all initial filenames to lowercase before saving.

    false
    Save without lowercase transformation (leave it as it were)
    [default] true
    Convert filenames to lowercase
  • Rename

    Controls whether the script should rename output files when saving. Renaming includes adding counter value and, optionally, suffix and prefix.

    false
    Don't rename output files
    [default] true
    Rename output files according to settings that follows

    Very useful option for arranging list of your images in ordered maner like "picture-01.jpg", "picture-02.jpg", etc.

    Note: if set to false and SaveInOneFolder is set to true, output files with the same names will be overwriting each other in order of script processing them in queue.

  • RenamePrefix

    Defines the string that adds to original filename as prefix. Works if Rename is set to true.

    [default] "g"
    Output files will be saved as "g01.jpg", "g02.jpg", etc. (according to following settings)
  • RenameSuffixS

    Defines the string that adds to thumbnail filename as suffix.

    [default] "g"
    Filenames will be converted from "SourceFilename" to "gSourceFilename" (or to "gsourcefilename" if LowerCase is ste to true)

    Note: works regardless of Rename setting (whether it is set to true or false) and applies for thumbnails only.

  • Digits

    Defines the number of digits in counter used in renaming of output files.

    [default] 2
    This defines the counter with values like 01, 02, ..., 98, 99, 100. If set to 3 (for example) it will produce numbers like 001, 002, ..., 098, 099, 100.

    Why whould you like the naming of files like that? Well, for purposes of sorting them in your file manager to begin with. Then, it can help you in a way to maintain the pattern for your web-gallery.

  • CounterStartValue [dialog]

    Defines the start value of counter used in renaming of output files.

    [default] 1
    The counetr will start with value "1", "01", "001", etc. (according to Digits value)

    Just in case you need to populate your existing gallery with new pictures and you want to preseve the order.

    Specifying counter value

After-party settings

  • Quit

    Controls whether the script should close Photoshop after performing its task or not.

    [default] false
    Don't close Photoshop
    true
    Close Photoshop after script completes

    Note: if set to true and there is another not saved document opened in Photoshop you'll be normally asked the standard "Save Changes" dialog.