ref: 200239cdda62ba801df9c079a773cca999348a90
parent: 61bdd5418803e3e64df2a6debe4b9159129e164d
author: phil9 <telephil9@gmail.com>
date: Fri Dec 9 04:49:43 EST 2022
add man page and markdown README
--- /dev/null
+++ b/README.md
@@ -1,0 +1,28 @@
+ifilter
+=======
+Image filters
+
+Installation
+-------------
+Clone the repository using `git/clone`
+```sh
+% cd ifilter
+% mk
+% mk install
+```
+
+Usage
+-----
+```sh
+% png -9 image.png | image/cfilter -f grayscale | image/dither | topng > out.png
+```
+See `ifilter(1)` for documentation.
+
+Author
+------
+phil9
+
+License
+-------
+MIT
+
--- /dev/null
+++ b/ifilter.man
@@ -1,0 +1,77 @@
+.TH IFILTER 1
+.SH NAME
+ifilter \- image filters
+.SH SYNOPSIS
+.B image/cfilter
+[
+.B -f
+.I filter
+] [
+.B -r
+.I ratio
+]
+.br
+.B image/blur
+[
+.B -f
+.I type
+] [
+.B -r
+.I radius
+] [
+.B -s
+.I stddev
+]
+.br
+.B image/pixelate
+[
+.B -s
+.I size
+]
+.br
+.B image/dither
+.SH DESCRIPTION
+These programs apply a filter on images read from the standard input and dump the resulting image on standard output.
+.TP
+.BR image/cfilter
+Applies a color filter to the input image. Possible filters are
+.IR grayscale ,
+.IR sepia ,
+.IR invert ,
+.IR shade
+and
+.IR tint .
+The
+.IR shade
+and
+.IR tint
+filters use the
+.B -r
+parameter as a percentage
+.IR ratio
+between source and target colors.
+.PP
+.TP
+.B image/blur
+Applies a low-pass filter to blur the input image. Possible filters are
+.IR box ,
+a simple filter using a 3x3 non-weighted convolution matrix or
+.IR gaussian ,
+which uses a weighted convolution matrix of size 2 *
+.I radius
++ 1 (default radius is 2 leading to a 5x5 matrix) and a standard deviation of
+.I stddev
+(defaults to 1.0).
+.PP
+.TP
+.B image/pixelate
+Increases the pixel size of the input image to
+.I size
+(defaults to 8).
+.TP
+.B image/dither
+Applies a Floyd-Steinberg error diffusion based dithering algorithm to the input image.
+.SH AUTHOR
+phil9
+.SH LICENSE
+MIT
--- a/mkfile
+++ b/mkfile
@@ -5,6 +5,7 @@
TARG=cfilter pixelate blur dither
HFILES=a.h
OFILES=common.$O
+MAN=/sys/man/1
default:V: all
@@ -14,4 +15,4 @@
mkdir -p $BIN
for(i in $TARG)
mk $MKFLAGS $i.install
-
+ cp ifilter.man $MAN/ifilter