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: 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
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
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 4d 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 0a 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 0a 0a 54 68 65 20 5c | 63 6f 64 65 7b 69 6d 61 |}..The \|code{ima|
|00000050| 67 65 6f 70 7d 20 6d 6f | 64 75 6c 65 20 63 6f 6e |geop} mo|dule con|
|00000060| 74 61 69 6e 73 20 73 6f | 6d 65 20 75 73 65 66 75 |tains so|me usefu|
|00000070| 6c 20 6f 70 65 72 61 74 | 69 6f 6e 73 20 6f 6e 20 |l operat|ions on |
|00000080| 69 6d 61 67 65 73 2e 0a | 49 74 20 6f 70 65 72 61 |images..|It opera|
|00000090| 74 65 73 20 6f 6e 20 69 | 6d 61 67 65 73 20 63 6f |tes on i|mages co|
|000000a0| 6e 73 69 73 74 69 6e 67 | 20 6f 66 20 38 20 6f 72 |nsisting| of 8 or|
|000000b0| 20 33 32 20 62 69 74 20 | 70 69 78 65 6c 73 0a 73 | 32 bit |pixels.s|
|000000c0| 74 6f 72 65 64 20 69 6e | 20 50 79 74 68 6f 6e 20 |tored in| Python |
|000000d0| 73 74 72 69 6e 67 73 2e | 20 20 54 68 69 73 20 69 |strings.| This i|
|000000e0| 73 20 74 68 65 20 73 61 | 6d 65 20 66 6f 72 6d 61 |s the sa|me forma|
|000000f0| 74 20 61 73 20 75 73 65 | 64 0a 62 79 20 5c 63 6f |t as use|d.by \co|
|00000100| 64 65 7b 67 6c 2e 6c 72 | 65 63 74 77 72 69 74 65 |de{gl.lr|ectwrite|
|00000110| 7d 20 61 6e 64 20 74 68 | 65 20 5c 63 6f 64 65 7b |} and th|e \code{|
|00000120| 69 6d 67 66 69 6c 65 7d | 20 6d 6f 64 75 6c 65 2e |imgfile}| module.|
|00000130| 0a 0a 54 68 65 20 6d 6f | 64 75 6c 65 20 64 65 66 |..The mo|dule def|
|00000140| 69 6e 65 73 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |ines the| followi|
|00000150| 6e 67 20 76 61 72 69 61 | 62 6c 65 73 20 61 6e 64 |ng varia|bles and|
|00000160| 20 66 75 6e 63 74 69 6f | 6e 73 3a 0a 0a 5c 72 65 | functio|ns:..\re|
|00000170| 6e 65 77 63 6f 6d 6d 61 | 6e 64 7b 5c 69 6e 64 65 |newcomma|nd{\inde|
|00000180| 78 73 75 62 69 74 65 6d | 7d 7b 28 69 6e 20 6d 6f |xsubitem|}{(in mo|
|00000190| 64 75 6c 65 20 69 6d 61 | 67 65 6f 70 29 7d 0a 0a |dule ima|geop)}..|
|000001a0| 5c 62 65 67 69 6e 7b 65 | 78 63 64 65 73 63 7d 7b |\begin{e|xcdesc}{|
|000001b0| 65 72 72 6f 72 7d 0a 54 | 68 69 73 20 65 78 63 65 |error}.T|his exce|
|000001c0| 70 74 69 6f 6e 20 69 73 | 20 72 61 69 73 65 64 20 |ption is| raised |
|000001d0| 6f 6e 20 61 6c 6c 20 65 | 72 72 6f 72 73 2c 20 73 |on all e|rrors, s|
|000001e0| 75 63 68 20 61 73 20 75 | 6e 6b 6e 6f 77 6e 20 6e |uch as u|nknown n|
|000001f0| 75 6d 62 65 72 20 6f 66 | 20 62 69 74 73 0a 70 65 |umber of| bits.pe|
|00000200| 72 20 70 69 78 65 6c 2c | 20 65 74 63 2e 0a 5c 65 |r pixel,| etc..\e|
|00000210| 6e 64 7b 65 78 63 64 65 | 73 63 7d 0a 0a 0a 5c 62 |nd{excde|sc}...\b|
|00000220| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 63 |egin{fun|cdesc}{c|
|00000230| 72 6f 70 7d 7b 69 6d 61 | 67 65 5c 2c 20 70 73 69 |rop}{ima|ge\, psi|
|00000240| 7a 65 5c 2c 20 77 69 64 | 74 68 5c 2c 20 68 65 69 |ze\, wid|th\, hei|
|00000250| 67 68 74 5c 2c 20 78 30 | 5c 2c 20 79 30 5c 2c 20 |ght\, x0|\, y0\, |
|00000260| 78 31 5c 2c 20 79 31 7d | 0a 52 65 74 75 72 6e 20 |x1\, y1}|.Return |
|00000270| 74 68 65 20 73 65 6c 65 | 63 74 65 64 20 70 61 72 |the sele|cted par|
|00000280| 74 20 6f 66 20 5c 76 61 | 72 7b 69 6d 61 67 65 7d |t of \va|r{image}|
|00000290| 2c 20 77 68 69 63 68 20 | 73 68 6f 75 6c 64 20 62 |, which |should b|
|000002a0| 79 0a 5c 76 61 72 7b 77 | 69 64 74 68 7d 20 62 79 |y.\var{w|idth} by|
|000002b0| 20 5c 76 61 72 7b 68 65 | 69 67 68 74 7d 20 69 6e | \var{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 0a 5c |t of pix|els of.\|
|000002e0| 76 61 72 7b 70 73 69 7a | 65 7d 20 62 79 74 65 73 |var{psiz|e} bytes|
|000002f0| 2e 20 5c 76 61 72 7b 78 | 30 7d 2c 20 5c 76 61 72 |. \var{x|0}, \var|
|00000300| 7b 79 30 7d 2c 20 5c 76 | 61 72 7b 78 31 7d 20 61 |{y0}, \v|ar{x1} a|
|00000310| 6e 64 20 5c 76 61 72 7b | 79 31 7d 20 61 72 65 20 |nd \var{|y1} are |
|00000320| 6c 69 6b 65 0a 74 68 65 | 20 5c 63 6f 64 65 7b 6c |like.the| \code{l|
|00000330| 72 65 63 74 72 65 61 64 | 7d 20 70 61 72 61 6d 65 |rectread|} parame|
|00000340| 74 65 72 73 2c 20 69 2e | 65 2e 5c 20 74 68 65 20 |ters, i.|e.\ the |
|00000350| 62 6f 75 6e 64 61 72 79 | 20 69 73 20 69 6e 63 6c |boundary| is incl|
|00000360| 75 64 65 64 20 69 6e 20 | 74 68 65 0a 6e 65 77 20 |uded in |the.new |
|00000370| 69 6d 61 67 65 2e 20 20 | 54 68 65 20 6e 65 77 20 |image. |The new |
|00000380| 62 6f 75 6e 64 61 72 69 | 65 73 20 6e 65 65 64 20 |boundari|es need |
|00000390| 6e 6f 74 20 62 65 20 69 | 6e 73 69 64 65 20 74 68 |not be i|nside th|
|000003a0| 65 20 70 69 63 74 75 72 | 65 2e 20 20 50 69 78 65 |e pictur|e. Pixe|
|000003b0| 6c 73 0a 74 68 61 74 20 | 66 61 6c 6c 20 6f 75 74 |ls.that |fall out|
|000003c0| 73 69 64 65 20 74 68 65 | 20 6f 6c 64 20 69 6d 61 |side the| old ima|
|000003d0| 67 65 20 77 69 6c 6c 20 | 68 61 76 65 20 74 68 65 |ge will |have the|
|000003e0| 69 72 20 76 61 6c 75 65 | 20 73 65 74 20 74 6f 20 |ir value| set to |
|000003f0| 7a 65 72 6f 2e 20 20 49 | 66 0a 5c 76 61 72 7b 78 |zero. I|f.\var{x|
|00000400| 30 7d 20 69 73 20 62 69 | 67 67 65 72 20 74 68 61 |0} is bi|gger tha|
|00000410| 6e 20 5c 76 61 72 7b 78 | 31 7d 20 74 68 65 20 6e |n \var{x|1} the n|
|00000420| 65 77 20 69 6d 61 67 65 | 20 69 73 20 6d 69 72 72 |ew image| is mirr|
|00000430| 6f 72 65 64 2e 20 20 54 | 68 65 20 73 61 6d 65 0a |ored. T|he same.|
|00000440| 68 6f 6c 64 73 20 66 6f | 72 20 74 68 65 20 79 20 |holds fo|r the y |
|00000450| 63 6f 6f 72 64 69 6e 61 | 74 65 73 2e 0a 5c 65 6e |coordina|tes..\en|
|00000460| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{funcde|sc}..\be|
|00000470| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 73 63 |gin{func|desc}{sc|
|00000480| 61 6c 65 7d 7b 69 6d 61 | 67 65 5c 2c 20 70 73 69 |ale}{ima|ge\, psi|
|00000490| 7a 65 5c 2c 20 77 69 64 | 74 68 5c 2c 20 68 65 69 |ze\, wid|th\, hei|
|000004a0| 67 68 74 5c 2c 20 6e 65 | 77 77 69 64 74 68 5c 2c |ght\, ne|wwidth\,|
|000004b0| 20 6e 65 77 68 65 69 67 | 68 74 7d 0a 52 65 74 75 | newheig|ht}.Retu|
|000004c0| 72 6e 20 5c 76 61 72 7b | 69 6d 61 67 65 7d 20 73 |rn \var{|image} s|
|000004d0| 63 61 6c 65 64 20 74 6f | 20 73 69 7a 65 20 5c 76 |caled to| size \v|
|000004e0| 61 72 7b 6e 65 77 77 69 | 64 74 68 7d 20 62 79 20 |ar{newwi|dth} by |
|000004f0| 5c 76 61 72 7b 6e 65 77 | 68 65 69 67 68 74 7d 2e |\var{new|height}.|
|00000500| 0a 4e 6f 20 69 6e 74 65 | 72 70 6f 6c 61 74 69 6f |.No inte|rpolatio|
|00000510| 6e 20 69 73 20 64 6f 6e | 65 2c 20 73 63 61 6c 69 |n is don|e, scali|
|00000520| 6e 67 20 69 73 20 64 6f | 6e 65 20 62 79 20 73 69 |ng is do|ne by si|
|00000530| 6d 70 6c 65 2d 6d 69 6e | 64 65 64 20 70 69 78 65 |mple-min|ded pixe|
|00000540| 6c 0a 64 75 70 6c 69 63 | 61 74 69 6f 6e 20 6f 72 |l.duplic|ation or|
|00000550| 20 72 65 6d 6f 76 61 6c | 2e 20 20 54 68 65 72 65 | removal|. There|
|00000560| 66 6f 72 65 2c 20 63 6f | 6d 70 75 74 65 72 2d 67 |fore, co|mputer-g|
|00000570| 65 6e 65 72 61 74 65 64 | 20 69 6d 61 67 65 73 20 |enerated| images |
|00000580| 6f 72 0a 64 69 74 68 65 | 72 65 64 20 69 6d 61 67 |or.dithe|red imag|
|00000590| 65 73 20 77 69 6c 6c 20 | 6e 6f 74 20 6c 6f 6f 6b |es will |not look|
|000005a0| 20 6e 69 63 65 20 61 66 | 74 65 72 20 73 63 61 6c | nice af|ter scal|
|000005b0| 69 6e 67 2e 0a 5c 65 6e | 64 7b 66 75 6e 63 64 65 |ing..\en|d{funcde|
|000005c0| 73 63 7d 0a 0a 5c 62 65 | 67 69 6e 7b 66 75 6e 63 |sc}..\be|gin{func|
|000005d0| 64 65 73 63 7d 7b 74 6f | 76 69 64 65 6f 7d 7b 69 |desc}{to|video}{i|
|000005e0| 6d 61 67 65 5c 2c 20 70 | 73 69 7a 65 5c 2c 20 77 |mage\, p|size\, w|
|000005f0| 69 64 74 68 5c 2c 20 68 | 65 69 67 68 74 7d 0a 52 |idth\, h|eight}.R|
|00000600| 75 6e 20 61 20 76 65 72 | 74 69 63 61 6c 20 6c 6f |un a ver|tical lo|
|00000610| 77 2d 70 61 73 73 20 66 | 69 6c 74 65 72 20 6f 76 |w-pass f|ilter ov|
|00000620| 65 72 20 61 6e 20 69 6d | 61 67 65 2e 20 20 49 74 |er an im|age. It|
|00000630| 20 64 6f 65 73 20 73 6f | 20 62 79 20 63 6f 6d 70 | does so| by comp|
|00000640| 75 74 69 6e 67 0a 65 61 | 63 68 20 64 65 73 74 69 |uting.ea|ch desti|
|00000650| 6e 61 74 69 6f 6e 20 70 | 69 78 65 6c 20 61 73 20 |nation p|ixel as |
|00000660| 74 68 65 20 61 76 65 72 | 61 67 65 20 6f 66 20 74 |the aver|age of t|
|00000670| 77 6f 20 76 65 72 74 69 | 63 61 6c 6c 79 2d 61 6c |wo verti|cally-al|
|00000680| 69 67 6e 65 64 20 73 6f | 75 72 63 65 0a 70 69 78 |igned so|urce.pix|
|00000690| 65 6c 73 2e 20 20 54 68 | 65 20 6d 61 69 6e 20 75 |els. Th|e main u|
|000006a0| 73 65 20 6f 66 20 74 68 | 69 73 20 72 6f 75 74 69 |se of th|is routi|
|000006b0| 6e 65 20 69 73 20 74 6f | 20 66 6f 72 65 73 74 61 |ne is to| foresta|
|000006c0| 6c 6c 20 65 78 63 65 73 | 73 69 76 65 0a 66 6c 69 |ll exces|sive.fli|
|000006d0| 63 6b 65 72 20 69 66 20 | 74 68 65 20 69 6d 61 67 |cker if |the imag|
|000006e0| 65 20 69 73 20 64 69 73 | 70 6c 61 79 65 64 20 6f |e is dis|played o|
|000006f0| 6e 20 61 20 76 69 64 65 | 6f 20 64 65 76 69 63 65 |n a vide|o device|
|00000700| 20 74 68 61 74 20 75 73 | 65 73 0a 69 6e 74 65 72 | that us|es.inter|
|00000710| 6c 61 63 69 6e 67 2c 20 | 68 65 6e 63 65 20 74 68 |lacing, |hence th|
|00000720| 65 20 6e 61 6d 65 2e 0a | 5c 65 6e 64 7b 66 75 6e |e name..|\end{fun|
|00000730| 63 64 65 73 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00000740| 75 6e 63 64 65 73 63 7d | 7b 67 72 65 79 32 6d 6f |uncdesc}|{grey2mo|
|00000750| 6e 6f 7d 7b 69 6d 61 67 | 65 5c 2c 20 77 69 64 74 |no}{imag|e\, widt|
|00000760| 68 5c 2c 20 68 65 69 67 | 68 74 5c 2c 20 74 68 72 |h\, heig|ht\, thr|
|00000770| 65 73 68 6f 6c 64 7d 0a | 43 6f 6e 76 65 72 74 20 |eshold}.|Convert |
|00000780| 61 20 38 2d 62 69 74 20 | 64 65 65 70 20 67 72 65 |a 8-bit |deep gre|
|00000790| 79 73 63 61 6c 65 20 69 | 6d 61 67 65 20 74 6f 20 |yscale i|mage to |
|000007a0| 61 20 31 2d 62 69 74 20 | 64 65 65 70 20 69 6d 61 |a 1-bit |deep ima|
|000007b0| 67 65 20 62 79 0a 74 72 | 65 73 68 6f 6c 64 69 6e |ge by.tr|esholdin|
|000007c0| 67 20 61 6c 6c 20 74 68 | 65 20 70 69 78 65 6c 73 |g all th|e pixels|
|000007d0| 2e 20 20 54 68 65 20 72 | 65 73 75 6c 74 69 6e 67 |. The r|esulting|
|000007e0| 20 69 6d 61 67 65 20 69 | 73 20 74 69 67 68 74 6c | image i|s tightl|
|000007f0| 79 20 70 61 63 6b 65 64 | 20 61 6e 64 0a 69 73 20 |y packed| and.is |
|00000800| 70 72 6f 62 61 62 6c 79 | 20 6f 6e 6c 79 20 75 73 |probably| only us|
|00000810| 65 66 75 6c 20 61 73 20 | 61 6e 20 61 72 67 75 6d |eful as |an argum|
|00000820| 65 6e 74 20 74 6f 20 5c | 63 6f 64 65 7b 6d 6f 6e |ent to \|code{mon|
|00000830| 6f 32 67 72 65 79 7d 2e | 0a 5c 65 6e 64 7b 66 75 |o2grey}.|.\end{fu|
|00000840| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00000850| 66 75 6e 63 64 65 73 63 | 7d 7b 64 69 74 68 65 72 |funcdesc|}{dither|
|00000860| 32 6d 6f 6e 6f 7d 7b 69 | 6d 61 67 65 5c 2c 20 77 |2mono}{i|mage\, w|
|00000870| 69 64 74 68 5c 2c 20 68 | 65 69 67 68 74 7d 0a 43 |idth\, h|eight}.C|
|00000880| 6f 6e 76 65 72 74 20 61 | 6e 20 38 2d 62 69 74 20 |onvert a|n 8-bit |
|00000890| 67 72 65 79 73 63 61 6c | 65 20 69 6d 61 67 65 20 |greyscal|e image |
|000008a0| 74 6f 20 61 20 31 2d 62 | 69 74 20 6d 6f 6e 6f 63 |to a 1-b|it monoc|
|000008b0| 68 72 6f 6d 65 20 69 6d | 61 67 65 20 75 73 69 6e |hrome im|age usin|
|000008c0| 67 20 61 0a 28 73 69 6d | 70 6c 65 2d 6d 69 6e 64 |g a.(sim|ple-mind|
|000008d0| 65 64 29 20 64 69 74 68 | 65 72 69 6e 67 20 61 6c |ed) dith|ering al|
|000008e0| 67 6f 72 69 74 68 6d 2e | 0a 5c 65 6e 64 7b 66 75 |gorithm.|.\end{fu|
|000008f0| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00000900| 66 75 6e 63 64 65 73 63 | 7d 7b 6d 6f 6e 6f 32 67 |funcdesc|}{mono2g|
|00000910| 72 65 79 7d 7b 69 6d 61 | 67 65 5c 2c 20 77 69 64 |rey}{ima|ge\, wid|
|00000920| 74 68 5c 2c 20 68 65 69 | 67 68 74 5c 2c 20 70 30 |th\, hei|ght\, p0|
|00000930| 5c 2c 20 70 31 7d 0a 43 | 6f 6e 76 65 72 74 20 61 |\, p1}.C|onvert a|
|00000940| 20 31 2d 62 69 74 20 6d | 6f 6e 6f 63 68 72 6f 6d | 1-bit m|onochrom|
|00000950| 65 20 69 6d 61 67 65 20 | 74 6f 20 61 6e 20 38 20 |e image |to an 8 |
|00000960| 62 69 74 20 67 72 65 79 | 73 63 61 6c 65 20 6f 72 |bit grey|scale or|
|00000970| 20 63 6f 6c 6f 72 20 69 | 6d 61 67 65 2e 0a 41 6c | color i|mage..Al|
|00000980| 6c 20 70 69 78 65 6c 73 | 20 74 68 61 74 20 61 72 |l pixels| that ar|
|00000990| 65 20 7a 65 72 6f 2d 76 | 61 6c 75 65 64 20 6f 6e |e zero-v|alued on|
|000009a0| 20 69 6e 70 75 74 20 67 | 65 74 20 76 61 6c 75 65 | input g|et value|
|000009b0| 20 5c 76 61 72 7b 70 30 | 7d 20 6f 6e 20 6f 75 74 | \var{p0|} on out|
|000009c0| 70 75 74 0a 61 6e 64 20 | 61 6c 6c 20 6f 6e 65 2d |put.and |all one-|
|000009d0| 76 61 6c 75 65 20 69 6e | 70 75 74 20 70 69 78 65 |value in|put pixe|
|000009e0| 6c 73 20 67 65 74 20 76 | 61 6c 75 65 20 5c 76 61 |ls get v|alue \va|
|000009f0| 72 7b 70 31 7d 20 6f 6e | 20 6f 75 74 70 75 74 2e |r{p1} on| output.|
|00000a00| 20 20 54 6f 0a 63 6f 6e | 76 65 72 74 20 61 20 6d | To.con|vert a m|
|00000a10| 6f 6e 6f 63 68 72 6f 6d | 65 20 62 6c 61 63 6b 2d |onochrom|e black-|
|00000a20| 61 6e 64 2d 77 68 69 74 | 65 20 69 6d 61 67 65 20 |and-whit|e image |
|00000a30| 74 6f 20 67 72 65 79 73 | 63 61 6c 65 20 70 61 73 |to greys|cale pas|
|00000a40| 73 20 74 68 65 0a 76 61 | 6c 75 65 73 20 5c 63 6f |s the.va|lues \co|
|00000a50| 64 65 7b 30 7d 20 61 6e | 64 20 5c 63 6f 64 65 7b |de{0} an|d \code{|
|00000a60| 32 35 35 7d 20 72 65 73 | 70 65 63 74 69 76 65 6c |255} res|pectivel|
|00000a70| 79 2e 0a 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |y..\end{|funcdesc|
|00000a80| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00000a90| 73 63 7d 7b 67 72 65 79 | 32 67 72 65 79 34 7d 7b |sc}{grey|2grey4}{|
|00000aa0| 69 6d 61 67 65 5c 2c 20 | 77 69 64 74 68 5c 2c 20 |image\, |width\, |
|00000ab0| 68 65 69 67 68 74 7d 0a | 43 6f 6e 76 65 72 74 20 |height}.|Convert |
|00000ac0| 61 6e 20 38 2d 62 69 74 | 20 67 72 65 79 73 63 61 |an 8-bit| greysca|
|00000ad0| 6c 65 20 69 6d 61 67 65 | 20 74 6f 20 61 20 34 2d |le image| to a 4-|
|00000ae0| 62 69 74 20 67 72 65 79 | 73 63 61 6c 65 20 69 6d |bit grey|scale im|
|00000af0| 61 67 65 20 77 69 74 68 | 6f 75 74 0a 64 69 74 68 |age with|out.dith|
|00000b00| 65 72 69 6e 67 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |ering..\|end{func|
|00000b10| 64 65 73 63 7d 0a 0a 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00000b20| 6e 63 64 65 73 63 7d 7b | 67 72 65 79 32 67 72 65 |ncdesc}{|grey2gre|
|00000b30| 79 32 7d 7b 69 6d 61 67 | 65 5c 2c 20 77 69 64 74 |y2}{imag|e\, widt|
|00000b40| 68 5c 2c 20 68 65 69 67 | 68 74 7d 0a 43 6f 6e 76 |h\, heig|ht}.Conv|
|00000b50| 65 72 74 20 61 6e 20 38 | 2d 62 69 74 20 67 72 65 |ert an 8|-bit gre|
|00000b60| 79 73 63 61 6c 65 20 69 | 6d 61 67 65 20 74 6f 20 |yscale i|mage to |
|00000b70| 61 20 32 2d 62 69 74 20 | 67 72 65 79 73 63 61 6c |a 2-bit |greyscal|
|00000b80| 65 20 69 6d 61 67 65 20 | 77 69 74 68 6f 75 74 0a |e image |without.|
|00000b90| 64 69 74 68 65 72 69 6e | 67 2e 0a 5c 65 6e 64 7b |ditherin|g..\end{|
|00000ba0| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00000bb0| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 64 69 74 68 |n{funcde|sc}{dith|
|00000bc0| 65 72 32 67 72 65 79 32 | 7d 7b 69 6d 61 67 65 5c |er2grey2|}{image\|
|00000bd0| 2c 20 77 69 64 74 68 5c | 2c 20 68 65 69 67 68 74 |, width\|, height|
|00000be0| 7d 0a 43 6f 6e 76 65 72 | 74 20 61 6e 20 38 2d 62 |}.Conver|t an 8-b|
|00000bf0| 69 74 20 67 72 65 79 73 | 63 61 6c 65 20 69 6d 61 |it greys|cale ima|
|00000c00| 67 65 20 74 6f 20 61 20 | 32 2d 62 69 74 20 67 72 |ge to a |2-bit gr|
|00000c10| 65 79 73 63 61 6c 65 20 | 69 6d 61 67 65 20 77 69 |eyscale |image wi|
|00000c20| 74 68 0a 64 69 74 68 65 | 72 69 6e 67 2e 20 20 41 |th.dithe|ring. A|
|00000c30| 73 20 66 6f 72 20 5c 63 | 6f 64 65 7b 64 69 74 68 |s for \c|ode{dith|
|00000c40| 65 72 32 6d 6f 6e 6f 7d | 2c 20 74 68 65 20 64 69 |er2mono}|, the di|
|00000c50| 74 68 65 72 69 6e 67 20 | 61 6c 67 6f 72 69 74 68 |thering |algorith|
|00000c60| 6d 20 69 73 0a 63 75 72 | 72 65 6e 74 6c 79 20 76 |m is.cur|rently v|
|00000c70| 65 72 79 20 73 69 6d 70 | 6c 65 2e 0a 5c 65 6e 64 |ery simp|le..\end|
|00000c80| 7b 66 75 6e 63 64 65 73 | 63 7d 0a 0a 5c 62 65 67 |{funcdes|c}..\beg|
|00000c90| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 67 72 65 |in{funcd|esc}{gre|
|00000ca0| 79 34 32 67 72 65 79 7d | 7b 69 6d 61 67 65 5c 2c |y42grey}|{image\,|
|00000cb0| 20 77 69 64 74 68 5c 2c | 20 68 65 69 67 68 74 7d | width\,| height}|
|00000cc0| 0a 43 6f 6e 76 65 72 74 | 20 61 20 34 2d 62 69 74 |.Convert| a 4-bit|
|00000cd0| 20 67 72 65 79 73 63 61 | 6c 65 20 69 6d 61 67 65 | greysca|le image|
|00000ce0| 20 74 6f 20 61 6e 20 38 | 2d 62 69 74 20 67 72 65 | to an 8|-bit gre|
|00000cf0| 79 73 63 61 6c 65 20 69 | 6d 61 67 65 2e 0a 5c 65 |yscale i|mage..\e|
|00000d00| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 62 |nd{funcd|esc}..\b|
|00000d10| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 67 |egin{fun|cdesc}{g|
|00000d20| 72 65 79 32 32 67 72 65 | 79 7d 7b 69 6d 61 67 65 |rey22gre|y}{image|
|00000d30| 5c 2c 20 77 69 64 74 68 | 5c 2c 20 68 65 69 67 68 |\, width|\, heigh|
|00000d40| 74 7d 0a 43 6f 6e 76 65 | 72 74 20 61 20 32 2d 62 |t}.Conve|rt a 2-b|
|00000d50| 69 74 20 67 72 65 79 73 | 63 61 6c 65 20 69 6d 61 |it greys|cale ima|
|00000d60| 67 65 20 74 6f 20 61 6e | 20 38 2d 62 69 74 20 67 |ge to an| 8-bit g|
|00000d70| 72 65 79 73 63 61 6c 65 | 20 69 6d 61 67 65 2e 0a |reyscale| image..|
|00000d80| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a |\end{fun|cdesc}. |
+--------+-------------------------+-------------------------+--------+--------+