rasclip <file>
Clip and/or scale an image file.
<file>
The image file to be edited. The result may be directed to another image
file (via the -of switch) or may be a file replacement
(without the -of switch).
-ang=<num>
Rotate the image through an angle, measured anticlockwise.
Currently only increments of 90 degrees are permitted.
-bit=1|2|3|4|8|24|32
Bits-per-pixel for the output image. 1 implies a
monochrome image and is equivalent to using the -mono
switch. 8 implies create the file with a maximum
of 256 colors. 24 implies create the file with true
color. The default value for a monochrome system is 1,
for color systems is 8.
-bmp
Produce output in .bmp format. Permitted image depths are 1, 8 and 24.
-c
If <file> exists, request confirmation
from the user before it is overwritten.
-clip=<nums>
Restrict output to a clipped portion of the image. nums
should be a 4-element numeric array specifying a rectangle in image co-ordinates,
left x, top y, right x, bottom y, where Y values run top to bottom starting at 0.
Clipping is done before any rotation.
-gam
Gamma correction for PNG output. If omitted, a suitable default is used.
-gif
Produce output in GIF format. All GIF images produced are 8-bit 256 color
images.
-gray
Produce a grayscale image file. This is not permitted for all output formats.
-hot=<x,y>
The pixel position of a hotspot associated with the image. If omitted, 0,0
is assumed. The Y coordinate system of an image has 0 at the top-left corner.
Note: of the supported output formats, only Xmarc images have a hotspot capability.
-int
Create an interlaced image file (PNG output only).
-jpg
Produce output in JPEG format. The image depth is coerced to 24-bit color.
-mono
Create a monochrome image file (even on a color system).
-of=<file>
Direct the output to create a new image file instead of overwriting the
input file indicated by the command parameter. The image type will be that of
the input file unless specified otherwise by one of the appropriate switches.
-phys=<nums>
For PNG output, supply the physical pixel dimensions as though the image were
a scanned image. The dimensions indicate "dots per meter" values.
One value may be supplied, applicable to both X and Y axes, or a 2-element array
may be supplied indicating separate X and Y values. For non-PNG output, this option is ignored.
-png
Produce output in PNG format. Permitted image depths are 2, 3, 4, 8, 24,32
for grayscale, 1 for monochrome, and 8,24,32 for color. Alpha-blended images
may be created using an image depth of 32.
-ras
Produce output in Xmarc image format. Permitted image depths are 1, 8 and 24.
-res=<num>
Specifies a change of image resolution. Setting this to any value other than 1
will effectively scale the image by this factor.
-scal=<nums>
For PNG output, supply the scale, namely what each pixel of the image represents in
meters. One value may be supplied, applicable to both X and Y axes, or a 2-element array
may be supplied indicating separate X and Y values. For non-PNG output, this option is ignored.
-tif
Produce output in Tiff format. Permitted image depths are 1, 4, 8, 24,32. Alpha-blended images
may be created using an image depth of 32.
-trans
Create a raster stencil (or alpha-blend for 32-bit PNG output) in the file to enable the image to be retrieved
in transparent mode.
-wbmp
Produce output in .wbmp format. The image depth is forced to 1.
-x=<num>
A scaling factor to be applied to the image width on output.
-y=<num>
A scaling factor to be applied to the image height on output.
-z=<num>
Compression level for some output formats:
PNG: A Z compression level. The range is 1 through 9.
Tiff: A compression type, 1 for LZW, 2 for RLE, 0 for none.
If omitted, a suitable default is used.
If no output format is specified (e.g. -bmp, -gif, -jpg, -png, -ras or -wbmp) the input image format and depth are used assuming they are permitted output values.
Clip a file myfile.jpg down to a 50 x 50 pixel extract:
rasclip myfile.jpg,-clip=<50,50,99,99>
Clip and reduce in scale a tiff image file, creating a new image file (we cannot output tiff, so we convert to 24-bit png):
rasclip mymap.tif,-clip=<0,0,640,480>,-res=0.5,-of=mymap1.png,-png,-bit=24
Commands: |