View Full Version : image resizing api library programming command line with Light Image Resizer

08-10-2011, 10:09 PM
You can use Light Image Resizer as a command line, so you can call it from anything like a batch script, .net , c# , csharp, cgi , visual basic or delphi

Feel free to ask any question about licensing or suggest any addition.
Basically you can find also all the options of Light Image Resizer in the registry, so you can easily program it the way you need it for your project.

Image Resizer Command Line Switches

Single file or folder

resize.exe <File/Folder> [Options]

e.g.: resize.exe c:\photos /profile=original /format=bmp /run

Several files

resize.exe <Filename1> <Filename2> ... [options]

e.g.: resize.exe c:\photos\image1.jpg c:\photos\image2.jpg /profile=desktop /run

Many files, using filelist

resize.exe /fl=<Filename> [Options]

e.g.: resize.exe /fl=c:\filelist.txt /w=800 /h=600 /run

Content of filelist.txt:


Profile to be used:
original = original resolution (default)
desktop = desktop resolution
or one of the available profile names.

Output width

Output height

Resolution unit, default is pixel.

Mode to use

Filtering mode

Output file format, default is original.

Compression quality from 1 to 100, only valid for JPG (default 80).

Adjust resolution for portrait images:
0 = off
1 = on (default)

Copy EXIF metadata (for JPG):
0 = off
1 = on (default)

Copy XMP metadata (for JPG):
0 = off
1 = on (default)

Copy IPTC metadata (for JPG):
0 = off
1 = on (default)

Copy embedded ICC profiles (for JPG):
0 = off
1 = on (default)

Embed watermark from image <filename>

Transparency for watermark from 0 (fully transparent) to 255 (opaque), default is 255.

Watermark position in output image:
0 = Top Left
1 = Top Center
2 = Top Right
3 = Bottom Left
4 = Bottom Center
5 = Bottom Right
6 = Center (default)

Horizontal spacing (pixels) for watermark if not centered, default is 0.

Vertical spacing (pixels) for watermark if not centered, default is 0.

/Mask=<filename mask>
Output filename mask to be used, see interface for more information. Default is "%F [%P]".

If enabled (1), keeps file date of original file. Default is disabled (0).

Change DPI to set value for formats that support it (JPEG, TIFF). Value can be 1 to 1000.

If enabled (1), colors will be inverted. Default is disabled (0).

If enabled (1), converts images to grayscale. Default is disabled (0).

If enabled (1), adds sepia effect to images. Default is disabled (0).

Policy to use (always resize, only enlarge, only reduce)

Action to be performed

Destination for output: same = same folder as original (default), desktop = Desktop, or a custom path.

Show details (log) during operation

Minimize progress window during operation

Close after images have been processed

If a folder is specified as the first parameter, this determines if subfolders will be scanned as well:
0 = off (default)
1 = on

Defines what to do in case of a filename conflict:
ask = display prompt to user
overwrite = overwrite without warning
skip = don't touch and skip file
rename = rename new file (e.g. "file (2)")

Start processing immediately