|
|
SImg.Exe
Command Line Tool
|
|
Overview:
Included with SImageUtil is a simple command line tool that can be used
for perform batch image operations without needing to write ASP
code. Below is a break-out of the command line arguments for
the tool and while it is simple tool, you can do a couple of neat
things with it. Check out the examples section, below the usage
information, on this page to get an idea.
Usage:
|
|
simg
|
source [-info] [-size] [-s w,h]
[-c x,y,w,h] [-bc c[,op]] [-tc c[,op]]
[-t# text] [-q ##] [-o dest] |
|
|
|
Source |
The filename of the source image to open. This field supports wild
cards. |
|
-info |
Dump the common Exif info fields for this image. |
|
-size |
Dump the image size (without loading the image). |
|
-s w,h |
Change the size of the image to w width by h height.
Note this operation always starts with the original image data, and will
retain the aspect ratio of the original image. |
|
-c x,y,w,h |
Crop the image. Note this operation always starts with
the original image data. |
|
-bc c[,op] |
Sets bounding box color to c and optional opacity op
for any subsequent text. Opacity default is 100% if not provided. |
|
-tc c[,op] |
Sets any subsequent text color to c and optional opacity
op. Opacity default is 100% if not provided. |
|
-t# text |
Writes text onto the resulting image at position #.
The regular formatting keywords are supports. See TextBox() for a
complete list of the keywords and position values. Note if you
add text to an image you probably want to set the output quality to a very
high number (like 95% or above). |
|
-q ## |
Sets the output compression quality to 1-100. The
default is 85% if not provided. |
|
-o dest |
Writes the current image the dest. Note if
there was more then one source file dest is assumed to be a
directory. |
|
Examples:
Convert a whole directory into JPGs:
|
simg myimages\*.gif
-q 75 -o webjpgs
Or if the directory only contains image files:
simg myimages\*
-q 75 -o webjpgs
Or to convert 1 image simply:
simg
sunrise.bmp -o sunrise.jpg
|
To dump Exif information about an image: |
|
simg
sunrise.jpb -info
To collect Exif information on a whole directory:
simg myimages\*.jpg
-info > exif.txt
Produces:
sunrise.jpg: Open Exif_Info
Make NIKON CORPORATION
Model Mod NIKON D1X
Software Ver.1.01
Program program
ISO 400
Lens 28-105mm f/3.5-4.5
Focal Length 28.0mm (35mm equivalent: 42mm)
Shutter 0.025s (1/40)
Aperture f/9.5
Focus manual
Meter multi-segment
White Balance auto
Sharpness normal
Resolution 3008 x 1960
Compression raw
Date 2001:11:08 07:53:55
|
|
Convert a whole directory into medium res & sized preview
images
|
simg *.jpg -s
640,480 -q 75 -o previews
Or into thumbnails
simg *.jpg -s
150,150 -q 75 -o thumbs
To convert 1 image simply:
simg
sunrise.jpg -s 150,150 -q 75 -o thumbs\sunrise.jpg
|
Convert a whole directory into preview images with a caption in the
lower right. Notice you need to set the size before you add the
caption.
|
simg *.jpg -s
640,480 -bc white,30 -t8 "Image by <i>Ken Reneris</i>"
-q 95 -o previews
Note you can use <font>, <b>, and some other tags in the
text line as well. See TextBox() for a complete description.
|
|
Produces:
|
You can process the image multiple times. So taking the above
example you can create previews, with captions, and thumbnails all at the
same time.
|
simg *.jpg -s
640,480 -bc white,30 -t8 "<font size=12>Image by <i>Ken
Reneris</i>" -q 95 -o previews -s 150,150 -q 75 -o thumbs
The thing to keep in mind when doing this is that simg
simply parses the arguments left to right. So:
|
|
|
*.jpg - for every
file ending in .jpg, open
|
|
|
|
-s 640,480
|
size the (original) image to 640,480
|
|
|
|
-bc white,30
|
set the textbox color to white with opacity of 30%
|
|
|
|
-t8 text
|
put text at position 8.
|
|
|
|
-q 95
|
set the output quality to 95%
|
|
|
|
-o previews
|
write the image to the previews directory
|
|
|
|
-s 640,480
|
size the (original) image to 150,150
|
|
|
|
-q 75
|
set the output quality to 75%
|
|
|
|
-o thumbs
|
write the image to the thumbs directory
|
simg sunrise.jpg -s 640,480 -bc white,0 -t1 "<font size=30
color=white face='comic sans ms' opacity=9><b>Nikon D1x</b>" -t8 "<font color=yellow>Sunrise over Lake Of The Woods" -q 85 -o
simgsamp2.jpg
|
|