Name
unweave — Removes artifacts from weave interlacing from images
Synopsis
unweave [
-afhpvV
] [
-i
INTERPOLATOR
] [
-k
{{even} | {odd}}
] [FILE...]
Description
unweave opens each file on the command line,
removes the artifacts generated by weave interlacing, and
overwrites the original file (except if
-p is specified).
The artifacts are removed by simply removing either the odd or the even field of the image, and interpolating them from the other field.
Options
-aAuto-detect whether the images contain artifacts, and only interpolate the files which do.
If the auto-detector detects artifacts in an image, then the image is processed as if
-ahad not been specified. If the auto-detector detects no artifacts, then the process is different:If neither
-fnor-pare specified, then the file is not touched.If
-fis specified but-pis not specified, then the image data is not modified, but the file is recompressed and the original overwritten.If
-fis not specified but-pis specified, then the input file is copied (not recompressed) to the output file.If both
-fand-pare specified, then the image data is not modified, but the file is recompressed and written to the output.
The autodetection algorithm works “quite well”, but it is not perfect. It is good enough for most purposes, but you should try it out yourself before deploying it on a large-scale basis.
-fThis option is only useful together with
-a. If it is specified, it forces recompression of all files, whether the image data was modified or not.-hDisplay some help and exit.
-iINTERPOLATORUse the specified interpolation method. The default is
linear. Currently the following interpolation methods are supported:copyIf the odd field is kept, copy each odd row to the row below. If the even field is kept, copy each even row to the row above. This generates jaggy images. If you do not understand what this means, then this method is probably not what you want.
linearDo a linear interpolation between the pixel exactly above and exactly below the pixel to be interpolated.
-k even|oddKeep the even or the odd field. “Keep odd” is the default.
-pTreat the file names as “source-destination” pairs, and do not overwrite the original files. The file names must be specified in this order:
SOURCE1DESTINATION1SOURCE2DESTINATION2…Obviously, you must specify an even number of files.
-vBe verbose.
-VDisplay version information and exit.
Image Formats
unweave uses the ImageMagick library for image I/O, and thus supports all the formats supported by ImageMagick.
The format of the input file is auto-detected; the format of the output file depends on the specified file extension. Since it is not possible to specify compression parameters, it is recommended to use a lossless format (such as PNG) for output. You can later change the file format with other tools such as convert(1).
Examples
Unweave an image using the linear interpolation method and keeping the even rows:
unweave -i linear -k even test.png
Unweave two a.png and
b.png and write them to
a_dest.png and b_dest.png:
unweave -p a.png a_dest.png b.png b_dest.png
Author
unweave is copyright (C) 2005 Aaron Isotton
<aaron@isotton.com>. You may use it under the terms of
the GNU General Public License.
Source code and newer versions are available from http://www.isotton.com/utils/unweave/.
Report bugs to <aaron@isotton.com> with
“[unweave]” as the first word of the subject.
