home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: libimageop.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text, with CR line terminators
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[CR]
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [R*ch] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 42 75 69 6c 74 2d 69 |\section|{Built-i|
|00000010| 6e 20 6d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |n module| \sectco|
|00000020| 64 65 7b 69 6d 61 67 65 | 6f 70 7d 7d 0d 5c 62 69 |de{image|op}}.\bi|
|00000030| 6d 6f 64 69 6e 64 65 78 | 7b 69 6d 61 67 65 6f 70 |modindex|{imageop|
|00000040| 7d 0d 0d 54 68 65 20 69 | 6d 61 67 65 6f 70 20 6d |}..The i|mageop m|
|00000050| 6f 64 75 6c 65 20 63 6f | 6e 74 61 69 6e 73 20 73 |odule co|ntains s|
|00000060| 6f 6d 65 20 75 73 65 66 | 75 6c 20 6f 70 65 72 61 |ome usef|ul opera|
|00000070| 74 69 6f 6e 73 20 6f 6e | 20 69 6d 61 67 65 73 2e |tions on| images.|
|00000080| 0d 49 74 20 6f 70 65 72 | 61 74 65 73 20 6f 6e 20 |.It oper|ates on |
|00000090| 69 6d 61 67 65 73 20 63 | 6f 6e 73 69 73 74 69 6e |images c|onsistin|
|000000a0| 67 20 6f 66 20 38 20 6f | 72 20 33 32 20 62 69 74 |g of 8 o|r 32 bit|
|000000b0| 20 70 69 78 65 6c 73 0d | 73 74 6f 72 65 64 20 69 | pixels.|stored i|
|000000c0| 6e 20 70 79 74 68 6f 6e | 20 73 74 72 69 6e 67 73 |n python| strings|
|000000d0| 2e 20 54 68 69 73 20 69 | 73 20 74 68 65 20 73 61 |. This i|s the sa|
|000000e0| 6d 65 20 66 6f 72 6d 61 | 74 20 61 73 20 75 73 65 |me forma|t as use|
|000000f0| 64 0d 62 79 20 5c 63 6f | 64 65 7b 67 6c 2e 6c 72 |d.by \co|de{gl.lr|
|00000100| 65 63 74 77 72 69 74 65 | 7d 20 61 6e 64 20 74 68 |ectwrite|} and th|
|00000110| 65 20 5c 63 6f 64 65 7b | 69 6d 67 66 69 6c 65 7d |e \code{|imgfile}|
|00000120| 20 6d 6f 64 75 6c 65 2e | 0d 0d 54 68 65 20 6d 6f | module.|..The mo|
|00000130| 64 75 6c 65 20 64 65 66 | 69 6e 65 73 20 74 68 65 |dule def|ines the|
|00000140| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 76 61 72 69 61 | followi|ng varia|
|00000150| 62 6c 65 73 20 61 6e 64 | 20 66 75 6e 63 74 69 6f |bles and| functio|
|00000160| 6e 73 3a 0d 0d 5c 72 65 | 6e 65 77 63 6f 6d 6d 61 |ns:..\re|newcomma|
|00000170| 6e 64 7b 5c 69 6e 64 65 | 78 73 75 62 69 74 65 6d |nd{\inde|xsubitem|
|00000180| 7d 7b 28 69 6e 20 6d 6f | 64 75 6c 65 20 69 6d 61 |}{(in mo|dule ima|
|00000190| 67 65 6f 70 29 7d 0d 0d | 5c 62 65 67 69 6e 7b 65 |geop)}..|\begin{e|
|000001a0| 78 63 64 65 73 63 7d 7b | 65 72 72 6f 72 7d 0d 54 |xcdesc}{|error}.T|
|000001b0| 68 69 73 20 65 78 63 65 | 70 74 69 6f 6e 20 69 73 |his exce|ption is|
|000001c0| 20 72 61 69 73 65 64 20 | 6f 6e 20 61 6c 6c 20 65 | raised |on all e|
|000001d0| 72 72 6f 72 73 2c 20 73 | 75 63 68 20 61 73 20 75 |rrors, s|uch as u|
|000001e0| 6e 6b 6e 6f 77 6e 20 6e | 75 6d 62 65 72 20 6f 66 |nknown n|umber of|
|000001f0| 20 62 69 74 73 0d 70 65 | 72 20 70 69 78 65 6c 2c | bits.pe|r pixel,|
|00000200| 20 65 74 63 2e 0d 5c 65 | 6e 64 7b 65 78 63 64 65 | etc..\e|nd{excde|
|00000210| 73 63 7d 0d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |sc}...\b|egin{fun|
|00000220| 63 64 65 73 63 7d 7b 63 | 72 6f 70 7d 7b 69 6d 61 |cdesc}{c|rop}{ima|
|00000230| 67 65 5c 2c 20 70 73 69 | 7a 65 5c 2c 20 77 69 64 |ge\, psi|ze\, wid|
|00000240| 74 68 5c 2c 20 68 65 69 | 67 68 74 5c 2c 20 78 30 |th\, hei|ght\, x0|
|00000250| 5c 2c 20 79 30 5c 2c 20 | 78 31 5c 2c 20 79 31 7d |\, y0\, |x1\, y1}|
|00000260| 0d 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 74 |.This fu|nction t|
|00000270| 61 6b 65 73 20 74 68 65 | 20 69 6d 61 67 65 20 69 |akes the| image i|
|00000280| 6e 20 5c 63 6f 64 65 7b | 69 6d 61 67 65 7d 2c 20 |n \code{|image}, |
|00000290| 77 68 69 63 68 20 73 68 | 6f 75 6c 64 20 62 79 0d |which sh|ould by.|
|000002a0| 5c 63 6f 64 65 7b 77 69 | 64 74 68 7d 20 62 79 20 |\code{wi|dth} by |
|000002b0| 5c 63 6f 64 65 7b 68 65 | 69 67 68 74 7d 20 69 6e |\code{he|ight} in|
|000002c0| 20 73 69 7a 65 20 61 6e | 64 20 63 6f 6e 73 69 73 | size an|d consis|
|000002d0| 74 20 6f 66 20 70 69 78 | 65 6c 73 20 6f 66 0d 5c |t of pix|els of.\|
|000002e0| 63 6f 64 65 7b 70 73 69 | 7a 65 7d 20 62 79 74 65 |code{psi|ze} byte|
|000002f0| 73 2c 20 61 6e 64 20 72 | 65 74 75 72 6e 73 20 74 |s, and r|eturns t|
|00000300| 68 65 20 73 65 6c 65 63 | 74 65 64 20 70 61 72 74 |he selec|ted part|
|00000310| 20 6f 66 20 74 68 61 74 | 20 69 6d 61 67 65 2e 20 | of that| image. |
|00000320| 5c 63 6f 64 65 7b 78 30 | 7d 2c 0d 5c 63 6f 64 65 |\code{x0|},.\code|
|00000330| 7b 79 30 7d 2c 20 5c 63 | 6f 64 65 7b 78 31 7d 20 |{y0}, \c|ode{x1} |
|00000340| 61 6e 64 20 5c 63 6f 64 | 65 7b 79 31 7d 20 61 72 |and \cod|e{y1} ar|
|00000350| 65 20 6c 69 6b 65 20 74 | 68 65 20 5c 63 6f 64 65 |e like t|he \code|
|00000360| 7b 6c 72 65 63 74 72 65 | 61 64 7d 0d 70 61 72 61 |{lrectre|ad}.para|
|00000370| 6d 65 74 65 72 73 2c 20 | 69 2e 65 2e 20 74 68 65 |meters, |i.e. the|
|00000380| 20 62 6f 75 6e 64 61 72 | 79 20 69 73 20 69 6e 63 | boundar|y is inc|
|00000390| 6c 75 64 65 64 20 69 6e | 20 74 68 65 20 6e 65 77 |luded in| the new|
|000003a0| 20 69 6d 61 67 65 2e 0d | 54 68 65 20 6e 65 77 20 | image..|The new |
|000003b0| 62 6f 75 6e 64 61 72 69 | 65 73 20 6e 65 65 64 20 |boundari|es need |
|000003c0| 6e 6f 74 20 62 65 20 69 | 6e 73 69 64 65 20 74 68 |not be i|nside th|
|000003d0| 65 20 70 69 63 74 75 72 | 65 2e 20 50 69 78 65 6c |e pictur|e. Pixel|
|000003e0| 73 20 74 68 61 74 20 66 | 61 6c 6c 0d 6f 75 74 73 |s that f|all.outs|
|000003f0| 69 64 65 20 74 68 65 20 | 6f 6c 64 20 69 6d 61 67 |ide the |old imag|
|00000400| 65 20 77 69 6c 6c 20 68 | 61 76 65 20 74 68 65 69 |e will h|ave thei|
|00000410| 72 20 76 61 6c 75 65 20 | 73 65 74 20 74 6f 20 7a |r value |set to z|
|00000420| 65 72 6f 2e 0d 49 66 20 | 5c 63 6f 64 65 7b 78 30 |ero..If |\code{x0|
|00000430| 7d 20 69 73 20 62 69 67 | 67 65 72 20 74 68 61 6e |} is big|ger than|
|00000440| 20 5c 63 6f 64 65 7b 78 | 31 7d 20 74 68 65 20 6e | \code{x|1} the n|
|00000450| 65 77 20 69 6d 61 67 65 | 20 69 73 20 6d 69 72 72 |ew image| is mirr|
|00000460| 6f 72 65 64 2e 20 54 68 | 65 0d 73 61 6d 65 20 68 |ored. Th|e.same h|
|00000470| 6f 6c 64 73 20 66 6f 72 | 20 74 68 65 20 79 20 63 |olds for| the y c|
|00000480| 6f 6f 72 64 69 6e 61 74 | 65 73 2e 0d 5c 65 6e 64 |oordinat|es..\end|
|00000490| 7b 66 75 6e 63 64 65 73 | 63 7d 0d 0d 5c 62 65 67 |{funcdes|c}..\beg|
|000004a0| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 73 63 61 |in{funcd|esc}{sca|
|000004b0| 6c 65 7d 7b 69 6d 61 67 | 65 5c 2c 20 70 73 69 7a |le}{imag|e\, psiz|
|000004c0| 65 5c 2c 20 77 69 64 74 | 68 5c 2c 20 68 65 69 67 |e\, widt|h\, heig|
|000004d0| 68 74 5c 2c 20 6e 65 77 | 77 69 64 74 68 5c 2c 20 |ht\, new|width\, |
|000004e0| 6e 65 77 68 65 69 67 68 | 74 7d 0d 54 68 69 73 20 |newheigh|t}.This |
|000004f0| 66 75 6e 63 74 69 6f 6e | 20 72 65 74 75 72 6e 73 |function| returns|
|00000500| 20 61 20 5c 63 6f 64 65 | 7b 69 6d 61 67 65 7d 20 | a \code|{image} |
|00000510| 73 63 61 6c 65 64 20 74 | 6f 20 73 69 7a 65 20 5c |scaled t|o size \|
|00000520| 63 6f 64 65 7b 6e 65 77 | 77 69 64 74 68 7d 20 62 |code{new|width} b|
|00000530| 79 0d 5c 63 6f 64 65 7b | 6e 65 77 68 65 69 67 68 |y.\code{|newheigh|
|00000540| 74 7d 2e 20 4e 6f 20 69 | 6e 74 65 72 70 6f 6c 61 |t}. No i|nterpola|
|00000550| 74 69 6f 6e 20 69 73 20 | 64 6f 6e 65 2c 20 73 63 |tion is |done, sc|
|00000560| 61 6c 69 6e 67 20 69 73 | 20 64 6f 6e 65 20 62 79 |aling is| done by|
|00000570| 0d 73 69 6d 70 6c 65 2d | 6d 69 6e 64 65 64 20 70 |.simple-|minded p|
|00000580| 69 78 65 6c 20 64 75 70 | 6c 69 63 61 74 69 6f 6e |ixel dup|lication|
|00000590| 20 6f 72 20 72 65 6d 6f | 76 61 6c 2e 20 54 68 65 | or remo|val. The|
|000005a0| 72 65 66 6f 72 65 2c 20 | 63 6f 6d 70 75 74 65 72 |refore, |computer|
|000005b0| 2d 67 65 6e 65 72 61 74 | 65 64 0d 69 6d 61 67 65 |-generat|ed.image|
|000005c0| 73 20 6f 72 20 64 69 74 | 68 65 72 65 64 20 69 6d |s or dit|hered im|
|000005d0| 61 67 65 73 20 77 69 6c | 6c 20 6e 6f 74 20 6c 6f |ages wil|l not lo|
|000005e0| 6f 6b 20 6e 69 63 65 20 | 61 66 74 65 72 20 73 63 |ok nice |after sc|
|000005f0| 61 6c 69 6e 67 2e 0d 5c | 65 6e 64 7b 66 75 6e 63 |aling..\|end{func|
|00000600| 64 65 73 63 7d 0d 0d 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00000610| 6e 63 64 65 73 63 7d 7b | 74 6f 76 69 64 65 6f 7d |ncdesc}{|tovideo}|
|00000620| 7b 69 6d 61 67 65 5c 2c | 20 70 73 69 7a 65 5c 2c |{image\,| psize\,|
|00000630| 20 77 69 64 74 68 5c 2c | 20 68 65 69 67 68 74 7d | width\,| height}|
|00000640| 0d 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 72 |.This fu|nction r|
|00000650| 75 6e 73 20 61 20 76 65 | 72 74 69 63 61 6c 20 6c |uns a ve|rtical l|
|00000660| 6f 77 2d 70 61 73 73 20 | 66 69 6c 74 65 72 20 6f |ow-pass |filter o|
|00000670| 76 65 72 20 61 6e 20 69 | 6d 61 67 65 2e 20 49 74 |ver an i|mage. It|
|00000680| 20 64 6f 65 73 0d 73 6f | 20 62 79 20 63 6f 6d 70 | does.so| by comp|
|00000690| 75 74 69 6e 67 20 65 61 | 63 68 20 64 65 73 74 69 |uting ea|ch desti|
|000006a0| 6e 61 74 69 6f 6e 20 70 | 69 78 65 6c 20 61 73 20 |nation p|ixel as |
|000006b0| 74 68 65 20 61 76 65 72 | 61 67 65 20 6f 66 20 74 |the aver|age of t|
|000006c0| 77 6f 0d 76 65 72 74 69 | 63 61 6c 6c 79 2d 61 6c |wo.verti|cally-al|
|000006d0| 69 67 6e 65 64 20 73 6f | 75 72 63 65 20 70 69 78 |igned so|urce pix|
|000006e0| 65 6c 73 2e 20 54 68 65 | 20 6d 61 69 6e 20 75 73 |els. The| main us|
|000006f0| 65 20 6f 66 20 74 68 69 | 73 20 72 6f 75 74 69 6e |e of thi|s routin|
|00000700| 65 20 69 73 20 74 6f 0d | 66 6f 72 65 73 74 61 6c |e is to.|forestal|
|00000710| 6c 20 65 78 63 65 73 73 | 69 76 65 20 66 6c 69 63 |l excess|ive flic|
|00000720| 6b 65 72 20 69 66 20 74 | 68 65 20 69 6d 61 67 65 |ker if t|he image|
|00000730| 20 69 73 20 64 69 73 70 | 6c 61 79 65 64 20 6f 6e | is disp|layed on|
|00000740| 20 61 20 76 69 64 65 6f | 0d 64 65 76 69 63 65 20 | a video|.device |
|00000750| 74 68 61 74 20 75 73 65 | 73 20 69 6e 74 65 72 6c |that use|s interl|
|00000760| 61 63 69 6e 67 2c 20 68 | 65 6e 63 65 20 74 68 65 |acing, h|ence the|
|00000770| 20 6e 61 6d 65 2e 0d 5c | 65 6e 64 7b 66 75 6e 63 | name..\|end{func|
|00000780| 64 65 73 63 7d 0d 0d 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00000790| 6e 63 64 65 73 63 7d 7b | 67 72 65 79 32 6d 6f 6e |ncdesc}{|grey2mon|
|000007a0| 6f 7d 7b 69 6d 61 67 65 | 5c 2c 20 77 69 64 74 68 |o}{image|\, width|
|000007b0| 5c 2c 20 68 65 69 67 68 | 74 5c 2c 20 74 68 72 65 |\, heigh|t\, thre|
|000007c0| 73 68 6f 6c 64 7d 0d 54 | 68 69 73 20 66 75 6e 63 |shold}.T|his func|
|000007d0| 74 69 6f 6e 20 63 6f 6e | 76 65 72 74 73 20 61 20 |tion con|verts a |
|000007e0| 38 2d 62 69 74 20 64 65 | 65 70 20 67 72 65 79 73 |8-bit de|ep greys|
|000007f0| 63 61 6c 65 20 69 6d 61 | 67 65 20 74 6f 20 61 20 |cale ima|ge to a |
|00000800| 31 2d 62 69 74 20 64 65 | 65 70 0d 69 6d 61 67 65 |1-bit de|ep.image|
|00000810| 20 62 79 20 74 72 65 73 | 68 6f 6c 64 69 6e 67 20 | by tres|holding |
|00000820| 61 6c 6c 20 74 68 65 20 | 70 69 78 65 6c 73 2e 20 |all the |pixels. |
|00000830| 54 68 65 20 72 65 73 75 | 6c 74 69 6e 67 20 69 6d |The resu|lting im|
|00000840| 61 67 65 20 69 73 20 74 | 69 67 68 74 6c 79 0d 70 |age is t|ightly.p|
|00000850| 61 63 6b 65 64 20 61 6e | 64 20 69 73 20 70 72 6f |acked an|d is pro|
|00000860| 62 61 62 6c 79 20 6f 6e | 6c 79 20 75 73 65 66 75 |bably on|ly usefu|
|00000870| 6c 20 61 73 20 61 6e 20 | 61 72 67 75 6d 65 6e 74 |l as an |argument|
|00000880| 20 74 6f 20 5c 63 6f 64 | 65 7b 6d 6f 6e 6f 32 67 | to \cod|e{mono2g|
|00000890| 72 65 79 7d 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |rey}..\e|nd{funcd|
|000008a0| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|000008b0| 63 64 65 73 63 7d 7b 64 | 69 74 68 65 72 32 6d 6f |cdesc}{d|ither2mo|
|000008c0| 6e 6f 7d 7b 69 6d 61 67 | 65 5c 2c 20 77 69 64 74 |no}{imag|e\, widt|
|000008d0| 68 5c 2c 20 68 65 69 67 | 68 74 7d 0d 54 68 69 73 |h\, heig|ht}.This|
|000008e0| 20 66 75 6e 63 74 69 6f | 6e 20 61 6c 73 6f 20 63 | functio|n also c|
|000008f0| 6f 6e 76 65 72 74 73 20 | 61 6e 20 38 2d 62 69 74 |onverts |an 8-bit|
|00000900| 20 67 72 65 79 73 63 61 | 6c 65 20 69 6d 61 67 65 | greysca|le image|
|00000910| 20 74 6f 20 61 20 31 2d | 62 69 74 0d 6d 6f 6e 6f | to a 1-|bit.mono|
|00000920| 63 68 72 6f 6d 65 20 69 | 6d 61 67 65 20 62 75 74 |chrome i|mage but|
|00000930| 20 69 74 20 75 73 65 73 | 20 61 20 28 73 69 6d 70 | it uses| a (simp|
|00000940| 6c 65 2d 6d 69 6e 64 65 | 64 29 20 64 69 74 68 65 |le-minde|d) dithe|
|00000950| 72 69 6e 67 20 61 6c 67 | 6f 72 69 74 68 6d 2e 0d |ring alg|orithm..|
|00000960| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0d 0d |\end{fun|cdesc}..|
|00000970| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00000980| 7b 6d 6f 6e 6f 32 67 72 | 65 79 7d 7b 69 6d 61 67 |{mono2gr|ey}{imag|
|00000990| 65 5c 2c 20 77 69 64 74 | 68 5c 2c 20 68 65 69 67 |e\, widt|h\, heig|
|000009a0| 68 74 5c 2c 20 70 30 5c | 2c 20 70 31 7d 0d 54 68 |ht\, p0\|, p1}.Th|
|000009b0| 69 73 20 66 75 6e 63 74 | 69 6f 6e 20 63 6f 6e 76 |is funct|ion conv|
|000009c0| 65 72 74 73 20 61 20 31 | 2d 62 69 74 20 6d 6f 6e |erts a 1|-bit mon|
|000009d0| 6f 63 68 72 6f 6d 65 20 | 69 6d 61 67 65 20 74 6f |ochrome |image to|
|000009e0| 20 61 6e 20 38 20 62 69 | 74 20 67 72 65 79 73 63 | an 8 bi|t greysc|
|000009f0| 61 6c 65 0d 6f 72 20 63 | 6f 6c 6f 72 20 69 6d 61 |ale.or c|olor ima|
|00000a00| 67 65 2e 20 41 6c 6c 20 | 70 69 78 65 6c 73 20 74 |ge. All |pixels t|
|00000a10| 68 61 74 20 61 72 65 20 | 7a 65 72 6f 2d 76 61 6c |hat are |zero-val|
|00000a20| 75 65 64 20 6f 6e 20 69 | 6e 70 75 74 20 67 65 74 |ued on i|nput get|
|00000a30| 20 76 61 6c 75 65 0d 5c | 63 6f 64 65 7b 70 30 7d | value.\|code{p0}|
|00000a40| 20 6f 6e 20 6f 75 74 70 | 75 74 20 61 6e 64 20 61 | on outp|ut and a|
|00000a50| 6c 6c 20 6f 6e 65 2d 76 | 61 6c 75 65 20 69 6e 70 |ll one-v|alue inp|
|00000a60| 75 74 20 70 69 78 65 6c | 73 20 67 65 74 20 76 61 |ut pixel|s get va|
|00000a70| 6c 75 65 20 5c 63 6f 64 | 65 7b 70 31 7d 0d 6f 6e |lue \cod|e{p1}.on|
|00000a80| 20 6f 75 74 70 75 74 2e | 20 54 6f 20 63 6f 6e 76 | output.| To conv|
|00000a90| 65 72 74 20 61 20 6d 6f | 6e 6f 63 68 72 6f 6d 65 |ert a mo|nochrome|
|00000aa0| 20 62 6c 61 63 6b 2d 61 | 6e 64 2d 77 68 69 74 65 | black-a|nd-white|
|00000ab0| 20 69 6d 61 67 65 20 74 | 6f 20 67 72 65 79 73 63 | image t|o greysc|
|00000ac0| 61 6c 65 0d 70 61 73 73 | 20 74 68 65 20 76 61 6c |ale.pass| the val|
|00000ad0| 75 65 73 20 5c 63 6f 64 | 65 7b 30 7d 20 61 6e 64 |ues \cod|e{0} and|
|00000ae0| 20 5c 63 6f 64 65 7b 32 | 35 35 7d 20 72 65 73 70 | \code{2|55} resp|
|00000af0| 65 63 74 69 76 65 6c 79 | 2e 0d 5c 65 6e 64 7b 66 |ectively|..\end{f|
|00000b00| 75 6e 63 64 65 73 63 7d | 0d 0d 5c 62 65 67 69 6e |uncdesc}|..\begin|
|00000b10| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 67 72 65 79 32 |{funcdes|c}{grey2|
|00000b20| 67 72 65 79 34 7d 7b 69 | 6d 61 67 65 5c 2c 20 77 |grey4}{i|mage\, w|
|00000b30| 69 64 74 68 5c 2c 20 68 | 65 69 67 68 74 7d 0d 43 |idth\, h|eight}.C|
|00000b40| 6f 6e 76 65 72 74 20 61 | 6e 20 38 2d 62 69 74 20 |onvert a|n 8-bit |
|00000b50| 67 72 65 79 73 63 61 6c | 65 20 69 6d 61 67 65 20 |greyscal|e image |
|00000b60| 74 6f 20 61 20 34 2d 62 | 69 74 20 67 72 65 79 73 |to a 4-b|it greys|
|00000b70| 63 61 6c 65 20 69 6d 61 | 67 65 20 77 69 74 68 6f |cale ima|ge witho|
|00000b80| 75 74 0d 64 69 74 68 65 | 72 69 6e 67 2e 0d 5c 65 |ut.dithe|ring..\e|
|00000b90| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|00000ba0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 67 |egin{fun|cdesc}{g|
|00000bb0| 72 65 79 32 67 72 65 79 | 32 7d 7b 69 6d 61 67 65 |rey2grey|2}{image|
|00000bc0| 5c 2c 20 77 69 64 74 68 | 5c 2c 20 68 65 69 67 68 |\, width|\, heigh|
|00000bd0| 74 7d 0d 43 6f 6e 76 65 | 72 74 20 61 6e 20 38 2d |t}.Conve|rt an 8-|
|00000be0| 62 69 74 20 67 72 65 79 | 73 63 61 6c 65 20 69 6d |bit grey|scale im|
|00000bf0| 61 67 65 20 74 6f 20 61 | 20 32 2d 62 69 74 20 67 |age to a| 2-bit g|
|00000c00| 72 65 79 73 63 61 6c 65 | 20 69 6d 61 67 65 20 77 |reyscale| image w|
|00000c10| 69 74 68 6f 75 74 0d 64 | 69 74 68 65 72 69 6e 67 |ithout.d|ithering|
|00000c20| 2e 0d 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00000c30| 0d 0d 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00000c40| 63 7d 7b 64 69 74 68 65 | 72 32 67 72 65 79 32 7d |c}{dithe|r2grey2}|
|00000c50| 7b 69 6d 61 67 65 5c 2c | 20 77 69 64 74 68 5c 2c |{image\,| width\,|
|00000c60| 20 68 65 69 67 68 74 7d | 0d 43 6f 6e 76 65 72 74 | height}|.Convert|
|00000c70| 20 61 6e 20 38 2d 62 69 | 74 20 67 72 65 79 73 63 | an 8-bi|t greysc|
|00000c80| 61 6c 65 20 69 6d 61 67 | 65 20 74 6f 20 61 20 32 |ale imag|e to a 2|
|00000c90| 2d 62 69 74 20 67 72 65 | 79 73 63 61 6c 65 20 69 |-bit gre|yscale i|
|00000ca0| 6d 61 67 65 20 77 69 74 | 68 0d 64 69 74 68 65 72 |mage wit|h.dither|
|00000cb0| 69 6e 67 2e 20 41 73 20 | 66 6f 72 20 5c 63 6f 64 |ing. As |for \cod|
|00000cc0| 65 7b 64 69 74 68 65 72 | 32 6d 6f 6e 6f 7d 2c 20 |e{dither|2mono}, |
|00000cd0| 74 68 65 20 64 69 74 68 | 65 72 69 6e 67 20 61 6c |the dith|ering al|
|00000ce0| 67 6f 72 69 74 68 6d 20 | 69 73 0d 63 75 72 72 65 |gorithm |is.curre|
|00000cf0| 6e 74 6c 79 20 76 65 72 | 79 20 73 69 6d 70 6c 65 |ntly ver|y simple|
|00000d00| 2e 0d 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00000d10| 0d 0d 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00000d20| 63 7d 7b 67 72 65 79 34 | 32 67 72 65 79 7d 7b 69 |c}{grey4|2grey}{i|
|00000d30| 6d 61 67 65 5c 2c 20 77 | 69 64 74 68 5c 2c 20 68 |mage\, w|idth\, h|
|00000d40| 65 69 67 68 74 7d 0d 43 | 6f 6e 76 65 72 74 20 61 |eight}.C|onvert a|
|00000d50| 20 34 2d 62 69 74 20 67 | 72 65 79 73 63 61 6c 65 | 4-bit g|reyscale|
|00000d60| 20 69 6d 61 67 65 20 74 | 6f 20 61 6e 20 38 2d 62 | image t|o an 8-b|
|00000d70| 69 74 20 67 72 65 79 73 | 63 61 6c 65 20 69 6d 61 |it greys|cale ima|
|00000d80| 67 65 2e 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |ge..\end|{funcdes|
|00000d90| 63 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00000da0| 65 73 63 7d 7b 67 72 65 | 79 32 32 67 72 65 79 7d |esc}{gre|y22grey}|
|00000db0| 7b 69 6d 61 67 65 5c 2c | 20 77 69 64 74 68 5c 2c |{image\,| width\,|
|00000dc0| 20 68 65 69 67 68 74 7d | 0d 43 6f 6e 76 65 72 74 | height}|.Convert|
|00000dd0| 20 61 20 32 2d 62 69 74 | 20 67 72 65 79 73 63 61 | a 2-bit| greysca|
|00000de0| 6c 65 20 69 6d 61 67 65 | 20 74 6f 20 61 6e 20 38 |le image| to an 8|
|00000df0| 2d 62 69 74 20 67 72 65 | 79 73 63 61 6c 65 20 69 |-bit gre|yscale i|
|00000e00| 6d 61 67 65 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |mage..\e|nd{funcd|
|00000e10| 65 73 63 7d 0d | |esc}. | |
+--------+-------------------------+-------------------------+--------+--------+