Tidy some priweavepng documentation
#!/usr/bin/env python
-# pipstack
-# Combine input PNG files into a multi-channel output PNG.
+# priweavepng
+# Weave selected channels from input PNG files into
+# a multi-channel output PNG.
import argparse
import collections
@@ -12,46 +13,20 @@ from array import array
import png
"""
-pipstack file1.png [file2.png ...]
+priweavepng file1.png [file2.png ...]
-pipstack can be used to combine 3 greyscale PNG files into a colour, RGB,
+priweavepng can be used to combine 3 greyscale PNG files into a colour, RGB,
PNG file. In fact it is slightly more general than that. The number of
-channels in the output PNG is equal to the sum of the numbers of
-channels in the input images. It is an error if this sum exceeds 4 (the
-maximum number of channels in a PNG image is 4, for an RGBA image). The
-output colour model corresponds to the number of channels: 1 -
-greyscale; 2 - greyscale+alpha; 3 - RGB; 4 - RGB+alpha.
+channels in the output PNG is equal to the number of selected
+input channels.
+It is an error if this sum exceeds 4
+(the maximum number of channels in a PNG image is 4, for an RGBA image).
+The output colour mode corresponds to the number of channels:o
+1 - greyscale; 2 - greyscale+alpha; 3 - RGB; 4 - RGB+alpha.
In this way it is possible to combine 3 greyscale PNG files into an RGB
PNG (a common expected use) as well as more esoteric options: rgb.png +
grey.png = rgba.png; grey.png + grey.png = greyalpha.png.
-
-Color Profile, Gamma, and so on.
-
-[This is not implemented yet]
-
-If an input has an ICC Profile (``iCCP`` chunk) then the output will
-have an ICC Profile, but only if it is possible to combine all the input
-ICC Profiles. It is possible to combine all the input ICC Profiles
-only when: they all use the same Profile Connection Space; the PCS white
-point is the same (specified in the header; should always be D50);
-possibly some other things I haven't thought of yet.
-
-If some of the inputs have a ``gAMA`` chunk (specifying gamma) and
-an output ICC Profile is being generated, then the gamma information
-will be incorporated into the ICC Profile.
-
-When the output is an RGB colour type and the output ICC Profile is
-synthesized, it is necessary to supply colorant tags (``rXYZ`` and so
-on). These are taken from ``sRGB``.
-
-If the input images have ``gAMA`` chunks and no input image has an ICC
-Profile then the output image will have a ``gAMA`` chunk, but only if
-all the ``gAMA`` chunks specify the same value. Otherwise a warning
-will be emitted and no ``gAMA`` chunk. It is possible to add or replace
-a ``gAMA`` chunk using the ``pipchunk`` tool.
-
-gAMA, pHYs, iCCP, sRGB, tIME, any other chunks.
"""
Image = collections.namedtuple("Image", "rows info")
