Home Features Download Buy Online Contact Links

Use PhotoWorker in Command Line


You can use PhotoWorker in command line to automate repetitive resizing tasks. To run PhotoWorker from command line, you need to write the command as something like (assume PhotoWorker is installed in "C:\Program Files\PhotoWorker"):

"C:\Program Files\PhotoWorker\PhotoWorker" -source:"f:\Temp\pic\normal" -dest:"f:\Temp\pic\small" -createshadow -shadowbackcolor:0000ff

Don't add ".exe" after PhotoWorker. In fact, "PhotoWorker.com" in the installation directory will be excuted. It will then call "PhotoWorker.exe".

Command line options format

All command line options are in following format:

{/|-}<Option Name>[:<Option Value>]

You may also add double quote "" on option value. This is necessary if the option value is a file name contains whitespaces. Examples of valid options:

/source:"c:\Program Files\My Pictures"
-createshadow
-paddingcolor:cc0000

General Options


-source:<Folder Name>

The source directory or file. If the path name contains whitespace, you must enclose it with double quote.
Example: -source:"c:\temp\my pictures"

-norecursive

By default, PhotoWorker will also search sub directories of the source directory. But if you specify -norecursive, PhotoWorker will skip sub directories.
Example: -norecursive

-dest:<Folder Name>

The destination directory or file. If the path name contains whitespace, you must enclose it with double quote.

Resize Setting


-mode:<Mode Type>

Choose conversion type. Default is fc. It can be one of the following values:
Mode Type Comment
fc Fixed width and height, keep aspect ratio by cropping
fp Fixed width and height, keep aspect ratio by padding
m Maximum width and height
w Fixed width, keep ratio
h Fixed height, keep ratio
r Change by ratio
n No resize
f Fixed width and height
fw Fixed width
fh Fixed height

Example: -mode:fp

-width:<Pixels>

Destination photo width. Default: 150.
Example: -width:120

-height:<Pixels>

Destination photo height. Default: 100.
Example: -height:100

-portraitwidth:<Pixels>

Destination portrait photo width. If you don't specify portraitwidth and portrait height, then all pictures will have the same size as defined by width & height. Otherwise, portrait and landscape pictures will use different size.
Example: -portraitwidth:100

-portraitheight:<Pixels>

Destination portrait photo height.
Example: -portraitheight:150

-ratio:<Percent>

Resize ratio in percent.
Example: -ratio:50

-cropleft:<Percent>

Horizontal crop left in percent. Valid values are 0-100. Default is 50.
Example: -cropleft:0

-croptop:<Percent>

Vertical crop top in percent. Valid values are 0-100. Default is 50.
Example: -croptop:100

-ratio:<Percent>

Resize ratio in percent. Default is 50.
Example: -ratio:30

-rotate:<Degree>

Rotate degree. Valid values are 0, 90, 180 and 270.
Example: -rotate:90

-paddingcolor:<HTML Color Code>

Padding and frame color. Use HTML color code. e.g., ff0000 is pure red, 0000ff is blue. ffffff is white, etc.
Example: -paddingcolor:cc0000

File Generation


-ext:<Destination File Extension>

Destination file type. Could be jpg, gif, bmp, png, tga and tif.
Example: -ext:png

-bpp:<Bit Depth>

Destination file bit depth. Could be 1, 8, 16, 24 or 32. Make sure it matches the destination file type.
Example: -bpp:8

-prefix:<Prefix String>

Prefix.
Example: -prefix:tn_

-suffix:<Suffix String>

Suffix.
Example: -suffix:_small

-jpegquality:<Quality>

JPEG Quality. Valid values are numbers from 1-100 or bad (10), average(25), normal(50), good(80) and superb(100). Default is 80.
Example: -jpegquality:90

-zeropadding:<Number of Padding>

Zero Padding. Default is 2.
Example: -zeropadding:2

-override

Override existing files.
Example: -override

-samedir

Keep directory structure
Example: -samedir

Additional Image Handling


-paddinghorz:<Pixels>

Horizontal frame thickness. If you specify paddinghorz, frame will be added.
Example: -paddinghorz:10

-paddingvert:<Pixels>

Vertical frame thickness. If you specify paddingvert, frame will be added.
Example: -paddingvert:10

-greyscale

Greyscale whole picture.
Example: -greyscale

-greyscale

Greyscale whole picture.
Example: -greyscale

Shadow Options


-createshadow

Create shadow. If you don't specify this option, no shadow will be generated.
Example: -createshadow

-shadowopaque:<Percent>

Shadow opaque. Valid values are 0-100. Default is 80.
Example: -shadowopaque:75

-shadowdistance:<Percent>

Shadow distance. Default is 7.
Example: -shadowdistance:10

-shadowangle:<Degrees>

Shadow angle. Default is 135.
Example: -shadowangle:45

-shadowblur:<Pixels>

Shadow blur. Default is 8.
Example: -shadowblur:75

-shadowcolor:<HTML Color Code>

Shadow color. Default is 0.
Example: -shadowcolor:ff0000

-shadowbackcolor:<HTML Color Code>

Shadow background color. Default is ffffff.
Example: -shadowbackcolor:0000ff

Overlay Options


-overlayfile:<File Name>

Specify overlay file. If you don't provide this option, no overlay will be added.
Example: -overlayfile:"c:\temp\my mask.png"

-overlayhalign:<Percent>

Horizontal align of overlay image. Valid values are 0-100. Default is 50.
Example: -overlayhalign:75

-overlayvalign:<Percent>

Vertical align of overlay image. Valid values are 0-100. Default is 50.
Example: -overlayvalign:0

-overlaytransparency:<Percent>

Overlay transparency. Valid values are 0-100. Default is 50.
Example: -overlaytransparency:0

-overlaytransparentcolor:<HTML Color Code>

Overlay transparent color.
Example: -overlaytransparentcolor:ff0000