2JPEG Command Line Syntax

2JPEG software is an advanced image converter. It can convert almost any image file to the JPG format in batch mode. Command line syntax described below allows choosing the source folder with image files you need to convert, selecting the image transformation algorithms 2JPEG will need to apply to image files, setting the destination folder path and changing the rules for naming output files.

To start converting image files to JPEG, please click the Start button in the bottom-left corner of your Windows desktop. You will then need to enter the specific command which you would like 2JPEG to fulfill, and click Enter.

In general, 2JPEG command line looks like:

2jpeg.exe -<switch1> [param1:value paramN:value] -<switchN> [parameters]

Switches

-src - Source folder of file to convert. For processing list of files, please save it as text file and use '@' before the file path.
-dst - Destination folder path.
-oper - Image processing operation name with parameters. Is empty by default.
-options - Common options with parameters. Is empty by default.

Command line examples:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out"

2jpeg.exe -src "C:\in\*.pdf" -dst "C:\out" -oper Resize size:"800 600" -options pages:"1,3,5-16,25" scansf:no

2jpeg.exe -src "@C:\in\list.txt" -dst "C:\out" -oper TextWatermark text:"(C) John Smith"

2jpeg.exe -src "C:\In\*.*" -dst "C:\Out" -options srcpwd:"my password"

2jpeg.exe -src "C:\In\*.*" -dst "C:\Out" -options overwrite:yes

2jpeg.exe -src "C:\In\*.*" -dst "C:\Out" -options overwrite:skip

Common options with parameters

pages - Pages range. All pages will be converted by default.
scansf - Scan source folder with all subfolders. Default value is "yes".
keepsf - Restore subfolders structure. Default value is "yes".
log - Create log file in folder "%TEMP%\2Jpeg_Log". Default value is "no".
overwrite - Rename new file or overwrite existing file. Default value is "no".
delsrc - Delete source file. Default value is "no".
template - Output file name template. Default value is "{Title}.jpg". Available macrosoes: {Title}, {Page}, {Ext}.
sort - Convert files in sorted order. Default value is "unsorted". Available values: unsorted, name, type, size, namedesc, typedesc, sizedesc.
srcpwd - Process password-protected Word and PDF files. Enter password in this format: srcpwd:"my password".
silent - Supress console output. Default value is "no".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -options pages:"1,3,5-12" scansf:no keepsf:no log:yes overwrite:yes delsrc:yes template:"{Title}-page{Page}.jpg" sort:name silent:yes

JPEG format parameters

mode - JPEG type. Default value is "baseline". Available values: baseline, extended, progressive, lossless.
bpp - Color depth. Default value is "24". Available values: 8, 24 and 32 bits per pixel.
quality - JPEG image quality from range 25..100. Default value is "85".
subsampling - YCbCr subsampling. Default value is "111". Available values: 111, 422, 421, 442 and 411.
opthuff - Optimize Huffman tables. Default value is "no".
interleaved - Interleaved data structure. Default value is "yes".
keepexif - Keep EXIF information in output file. Default value is "yes".
keepiptc - Keep IPTC information in output file. Default value is "yes".
thumbnail - Create thumbnail image. Default value is "no".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -jpeg mode:progressive bpp:8 quality:50 subsampling:422 opthuff:yes interleaved:no keepexif:no keepiptc:no thumbnail:yes

Image processing operations

Crop image

method - Crop method. Available values: margins, rect2p, rect_pwh or autocrop.
left - Left margin in pixels. Default value is: "0".
top - Top margin. Default value is: "0".
right - Right margin for "margins" and "rect2p" method. Default value is: "0".
bottom - Bottom margin for "margins" and "rect2p" method. Default value is: "0".
width - Crop width for "rect_pwh" method. Default value is: "0".
height - Crop height for "rect_pwh" method. Default value is: "0".
color - Color code for autocrop mode. Default value is: "r:255,g:255,b:255,a:255"
tolerance - Color tolerance value for autocrop from range 0..100%. Default value is: "0"

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Crop method:margins left:100 top:100 right:200 bottom:200

Mirror image

flip - flip direction. Available values: verticaly, horizontaly or both.

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Mirror flip:verticaly

Rasterize vector file

res - rasterization resolution from range 72..4096 DPI or DPC. Default value is: "200".
units - resolution units. Available values: DPI (dots per inch) or DPC (dots per centimeter). Default value is: "DPI".

Command line example:

2jpeg.exe -src "C:\in\*.pdf" -dst "C:\out" -oper Rasterize res:300

Resize image

size - New image width and height limits.
units - Image size units. Available values: pixels or percents. Default value is: "pixels".
keepprop - Keep original image proportions. Default value is: "yes".
method - Resize method. Available values: neighbour or bilinear. Default value is: "bilinear".
nozoom - Skip resize, if source image size smaller. Default value is: "no".
fmode - Fit mode. Available values: scale, fit_in_size, fill_in_size, fit_width, fit_height. Default value is: "scale".
falign - Fit alignment. Available values: center, left_top, right_bottom. Default value is: "center".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Resize size:"80 60" units:percents keepprop:no method:neighbour nozoom:yes

Image rotation

angle - Rotation angle. Ange: 0-360 degrees.
direction - Rotation direction. Available values: CCW and CW. Default value is: "CCW".
color - Background color. Default value is: "r:255,g:255,b:255"

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Rotate angle:45 color:"r:255,g:0,b:255"

Text watermark

pages - Pages range in multipage file. By default text watermark will placed on each page.
text - Watermark text string.
font - Watermark font name. Default value is: "Arial".
fontsize - Watermark font size. Default value is: "12".
bold - Use BOLD font. Default value is: "no".
italic - Use ITALIC font. Default value is: "no".
underline - Use UNDERLINED font. Default value is: "no".
halign - Text string horizontal alignment. Available values: left, center, right. Default value is: "left".
valign - Text string vertical alignment. Available values: top, center, bottom. Default value is: "top".
offx - Text string horizontal offset. Default value is: "0".
offy - Text string vertical offset. Default value is: "0".
color - Text color. Default value is: "r:0,g:0,b:0,a:255".
bkcolor - Text background color. Default value is: "r:255,g:255,b:255,a:255".
angle - Rotation angle in degrees. Default value is: "0".
direction - Rotation direction. Available values: CCW and CW. Default value is: "CCW".
border - Text watermark border. Default value is: "no".
fit - Fit text into image. Default value is: "no".
method - Text blending method. Available values: alphablend and overdraw. Default value is: "alphablend".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper TextWatermark pages:"1,3-5" text:"(C) John Smith" font:"Verdana" fontsize:25 bold:yes italic:yes underline:yes halign:center valign:center offx:10 offy:15 color:"r:255,g:0,b:0,a:128" bkcolor:"r:0,g:255,b:0,a:128" angle:45 border:yes

Picture watermark

pages - Pages range in multipage file. By default text watermark will placed on each page.
image - Path to the watermark image file.
halign - Picture watermark horizontal alignment. Available values: left, center, right. Default value is: "left".
valign - Picture watermark vertical alignment. Available values: top, center, bottom. Default value is: "top".
offx - Picture watermark horizontal offset. Default value is: "0".
offy - Picture watermark vertical offset. Default value is: "0".
method - Text blending method. Available values: alphablend and overdraw. Default value is: "alphablend".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper watermark pages:"1,3-5" image:"C:\my logo.png" halign:center valign:center offx:10 offy:15

Grayscale

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Grayscale

Skip alpha channel value (transparency)

Command line example:

2jpeg.exe -src "C:\In\*.*" -dst "C:\Out" -oper skip_alpha

Unsharpen mask

radius from range 0..250 pixels. Default value is: "5".
amount from range 0..500 pixels. Default value is: "100".
threshold from range 0..255. Default value is: "3".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Sharpen radius:10 amount:25 threshold:5

Autolevels

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Autolevels

Blur

radius from range 0..250 pixels. Default value is: "5".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Blur radius:10

Contrast

percent - contrast correction value from range -100..100%. Default value is: "0".
auto - automatically contrast correction. Default value is: "yes".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Contrast percent:-10 auto:no

Gamma correction

percent - gamma correction value from range -100..100%. Default value is: "1".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Gamma percent:-10

Brightness

percent - brightness correction value from range -100..100%. Default value is: "10".

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Brightness percent:-10

Sepia

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Sepia

Smoothing noise

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper Smoothingnoise

Drop Color

src_color - source color that should be replaced: "red", "green" or "blue".
dst_color - destination color in RGBA format: "r:(0-255),g:(0-255),b:(0-255),a:(0-255)"

Command line example:

2jpeg.exe -src "C:\in\*.*" -dst "C:\out" -oper dropcolor src_color:green dst_color:"r:255,g:255,b:255:a255"