ms2img(1)

ms2img(1) mapsoft2 ms2img(1)

NAME

ms2img -- mapsoft2 converter for raster images

SYNOPSIS

        ms2img <options> <input file> <output file>

DESCRIPTION

ms2conv converts raster images (PNG, TIFF, GIF, JPG). Can be used to change image format, colormap or scale.

GENERAL OPTIONS

-h, --help
Show help message.
--pod
Show help message as POD template.
-v, --verbose
Be verbose.

Options for saving images

--img_out_fmt <arg>
Explicitely set image format: jpeg, png, gif, tiff, pnm
--tiff_format <arg>
When writing TIFF, convert image to one of following forms: argb, rgb, argb64, rgb64, grey, pal (default depends on the image).
--tiff_compression <arg>
Set compression algorythm for writing TIFF files: none, ccit_rle, ccit_rlew, ccit_fax3, ccit_fax4, lzw (default), jpeg, packbits
--tiff_minwhite <arg>
When writing greyscale TIFF, use MINISWHITE colors (default: 0).
--jpeg_quality <arg>
Set JPEG quality for writing jpeg and tiff files (default 95).
--png_format <arg>
When writing PNG, convert image to one of following forms: argb, rgb, grey, agrey, pal (default depends on the image).
--cmap_colors <arg>
Colormap size for reducing image colors (0..256, default 255, if 0 - use all colors). Image colors are reduced when saving to GIF, to PNG with --png_format=pal, to TIFF with --tiff_format=pal.
--cmap_alpha <arg>
Alpha channel: none (default) -- remove it; full -- treat it equally with other channels; gif -- keep only fully-transparent color, if needed. When saving GIF file (which supports only fully transparent color) "full" works in the same way as "gif".
--cmap_dim_method <arg>
Analog of pnmcolormap options -spreadbrightness and -spreadluminosity. When a box in the color space is measured, color dimensions can be treated equally or with luminosity factors. Values: norm (default) or lumin.
--cmap_rep_method <arg>
Analog of pnmcolormap options -center, -meancolor, and -meanpixel. When a box in the color space is chosen, it can be represented by its geometrical center, or by averaging pixels or colors in it. Values: center, meanpix (default), meancol.
--cmap_split_method <arg>
Analog of pnmcolormap options -splitpix, -splitcol, -splitdim. How to choose a box in the color space for splitting: by its maximum dimension, maximum number of pixels or colors in it. Values: maxdim (default), maxpix, maxcol.
--cmap_save <arg>
Save colormap to PNG file.
--cmap_load <arg>
Load colormap from PNG file.
--cmap_add <arg>
Add a color to colormap (useful to add transparent color to non-transparent colormap) TODO: allow multiple colors.
--scale <arg>
Downscaling factor, double value (default: 1.0)
--invert
Invert image
--autolevel <arg>
Do auto color levels. Color components are transformed as f(x) = a-c/(a-x) in such a way that the darkest color becomes black, lightest one becomes white, average color becomes the value set by the option argument. Argument is one floating-point number (for all components) or three comma-separated numbers in the range 0..1, reasonable value is near 0.5. If --invert option is set then the transformation happens after the inversion. Color min/max/avr values are calculated in the central part determined by the --border option.
--autolevel_th <arg>
Skip some fraction on white/black colors in the autolevel calculation. Argument is one or two (for white and black) numbers in the range 0..1. Default is 0,0.
--ir_undust <arg>
Remove dust using IR channel. Argument is a file with the IR channel
--ir_undust_sh <arg>
Shift of the IR channel, [x,y] in pixels.
--ir_undust_th <arg>
Threshold for the IR channel, default 0.06.
--crop <arg>
Crop image to a rectangular area (intersection with the image coordinate range). Argument is json array with 4 numbers: [<x>,<y>,<w>,<h>]
--autocrop
Crop image automatically, remove all 'bad' lines from each side within region specified by --border.
--autocrop_ref <arg>
Use another image for autocrop calculations.
--border <arg>
Border for --autolevel and --autocrop calculations (pixels, default 50)

FILTER ORDER

filters are applied in the following order: invert, autolevel, crop, autocrop.

AUTHOR

Vladislav Zavjalov <slazav@altlinux.org>

SEE ALSO

  • Mapsoft2 documentation (ru, en) <http://slazav.github.io/mapsoft2>
  • Mapsoft2 source code, bugtracker <http://github.com/slazav/mapsoft2>
  • Old Mapsoft project <http://github.com/ushakov/mapsoft>
2024-07-26 mapsoft2