mifcon  -  mtPaint Image File Converter (Part of libmtpixel 0.40)

mifcon uses libmtpixel to convert bitmap image files from one format to
another.  It works by loading the file(s), then doing any transformations,
and finally saving a new file with the new format extension (possibly
overwriting the old file if the format extension doesn't change).

Usage:

mifcon [OPTION]... [IMAGE FILE]...


Options:
--------
  --help                  Output this help
  --version               Output version information

  -v                      Verbose
  -skip                   Don't terminate when errors occur
  -list                   List file formats supported
  -info                   Output image information
  -dontsave               Don't save the image file
  -action                 Force execution of actions, and don't save an image file
  -passive                Don't do any transformations or file saving
  -o <string>             Output image to this file
  -d <string>             Output all image files to this directory
  -format <string>        File format to create (default = png)
  -fv <integer>           Set format value, e.g. PNG/JPEG compression
  -clear <int>            Set the clear palette colour for resize, etc (default=0)

  -gamma <integer>        Adjust gamma of image (20..500, 100=no change)
  -brightness <integer>   Adjust brightness of image (-255..255, 0=no change)
  -contrast <integer>     Adjust contrast of image (-100..100, 0=no change)
  -saturation <integer>   Adjust saturation of image (-100..100, 0=no change)
  -hue <integer>          Adjust hue of image (-1529..1529, 0=no change)
  -posterize <integer>    Posterize image (1..7, bits per RGB channel)
  -trans_r                Don't adjust red channel for colour transformations
  -trans_g                Don't adjust green channel for colour transformations
  -trans_b                Don't adjust blue channel for colour transformations

  -rotate <float>         Rotate image by this angle (degrees)
  -rotnn                  Rotate using nearest neightbour method
  -rotsm                  Rotate using smooth method (default)
  -rotgc                  Rotate using gamma correction
  -rotnogc                Rotate without using gamma correction (default)

  -bacteria <integer>     Bacteria effect, repeated <integer> times
  -edge                   Edge detect effect
  -emboss                 Emboss effect
  -fliph                  Flip image horizontally
  -flipv                  Flip image vertically
  -grid <string>          Grid effect <scalew,scaleh,xgrid,ygrid>
  -invert                 Invert image
  -sharpen <integer>      Sharpen image by given amount
  -soften <integer>       Soften image by given amount
  -gauss <string>         Apply Gaussian blur <radX,radY,gamma>
                          radX/radY=(0-200.0), gamma=0,1
  -unsharp <string>       Apply unsharp mask <radius,amount,threshold,gamma>
                          radius=0-200.0, amount=0-10.0, threshold=0..255, gamma=0,1

  -scale <string>         Scale image to <width,height>
  -scalef <float>         Scale image by this factor
  -scalew <integer>       Scale image to this width, preserving aspect ratio
  -scalewf <float>        Scale image width by this factor
  -scaleh <integer>       Scale image to this height, preserving aspect ratio
  -scalehf <float>        Scale image height by this factor

  -scalebi                Scale using bilinear/area mapping method
  -scalebh                Scale using Blackman-Harris method (default)
  -scalecub               Scale using bicubic method
  -scalecubb              Scale using bicubic-better method
  -scalecube              Scale using bicubic-edged method
  -scalecubs              Scale using bicubic-sharper method
  -scalenn                Scale using nearest neighbour method

  -scalesharp             Scale with sharpening (default)
  -scalesmooth            Scale without sharpening
  -scalenogamma           Scale without gamma correction (default)
  -scalegamma             Scale with gamma correction

  -resize <string>        Resize image to <width,height,x_offset,y_offset>
  -resizemt <string>      Resize in mirror tile mode
  -resizetile <string>    Resize in tile mode

  -rgb                    Convert indexed images to RGB
  -indexed                Convert RGB images to indexed

  -qcols <integer>        Maximum colours to use in indexed image (default=256)
  -qpal <string>          Quantize using a specified palette file (GPL format)
  -qp                     Quantize using default mtPaint palette
  -qmm                    Use Max-Min quantizer
  -qpnn                   Use PNN quantizer
  -qwu                    Use Wu quantizer (default)

  -qnone                  Don't dither pixels
  -qfloyd1                Use Floyd-Steinberg dithering
  -qfloyd2                Use Floyd-Steinberg dithering, quick (default)
  -qstucki                Use Stucki dithering
  -qdither                Use dithering effect
  -qscatter               Use scattered effect

  -qcrgb                  Use RGB colour space
  -qcsrgb                 Use sRGB colour space (default)
  -qclxn                  Use LXN colour space

  -qlinf                  Use largest difference measure
  -qsuml1                 Use Sum (L1) difference measure
  -qeucl2                 Use Euclidean (L2) difference measure (default)

  -qbgamut                Use gamut colour bleed reduction (default)
  -qbweakly               Use weakly colour bleed reduction
  -qbstrongly             Use strongly colour bleed reduction

  -qserpentine            Use serpentine scan (default)
  -qserpentineoff         Don't use serpentine scan
  -qerrp <val>            Value for error propagation 0-100 (default=100)

  -qsepoff                Don't use selective error propagation (default)
  -qsepsum                Use Separate/Sum selective error propagation
  -qsepsplit              Use Separate/Split selective error propagation
  -qseplsum               Use Length/Sum selective error propagation
  -qseplsplit             Use Length/Split selective error propagation

  -qfullerron             Use full error precision
  -qfullerroff            Don't use full error precision (default)

  -isolsd                 Isometric transform - Left Side Down
  -isorsd                 Isometric transform - Right Side Down
  -isotsr                 Isometric transform - Top Side Right
  -isobsr                 Isometric transform - Bottom Side Right

  -palload <string>       Load palette file
  -palsave <string>       Save palette file
  -palsaved <string>      Save palette file to this directory (image filename + .gpl)
  -palsize <int>          Set the palette size (1..256)
  -palsort <string>       Sort palette <start,finish,reverse,type>
                          type = hue, sat, lum, r, g, b, or fre : Hue, Saturation,
                          Luminance, Red, Green, Blue, Frequency (indexed only)
  -palunused              Remove unused colours from the palette
  -paldup                 Remove duplicate colours from the palette
  -palshift <string>      Shift palette colours <start,finish,shifts>

  -ascii <string>         Export indexed image to ASCII text file

When multiple image transformations are specified they are carried out in
the order that they are specified.

Examples:
---------
To convert input.gif to input.png:

  mifcon input.gif

To create a directory of GIF thumbnails from JPEG images and give a
verbose description of all actions:

  mifcon -v -scalew 80 -indexed -format gif -d thumbs *.jpg

To display information about some PNG files:

  mifcon -info *.png

To load some PNG images without doing anything with them, skipping
any errors encountered (useful for file auditing):

  mifcon -v -passive -skip *.png

To create input.png, force rescaling of an image ignoring the original
aspect ratio:

  mifcon -scale 100,100 input.jpg

To crop a photo of size 1000 x 1000 to the central 100 x 100 area, and then
mirror tile the 100 x 100 image up to 500 x 500:

  mifcon -resize 100,100,-450,-450 -o file2.png file1.jpg
  mifcon -resizemt 500,500,0,0 -o file3.png file2.png

Scale image.jpg image by factor of 2 and draw mock horizontal CRT lines to
create image.png:

  mifcon -grid 2,2,2,0 image.jpg

To load a GIF file, save the palette but not the image:

  mifcon -palsave pal.gpl -dontsave file.gif

To load palette file pal1.gpl, sort colours 10-20 by reverse hue, save the new
palette to pal2.gpl, not loading or saving an image file:

  mifcon -palload pal1.gpl -palsort 10,20,1,hue -palsave pal2.gpl -action

Extract palettes from a bunch of GIF files and put them into the 'palette'
directory:

  mifcon -palsaved palette -dontsave *.gif

