Bitmap/Read a PPM file: Difference between revisions
Content added Content deleted
No edit summary |
(→{{header|Tcl}}: a few more notes) |
||
Line 425: | Line 425: | ||
$image read $file -format ppm |
$image read $file -format ppm |
||
}</lang> |
}</lang> |
||
Thus, to read a PPM, convert it to grayscale, and write it back out again becomes this (which requires Tcl 8.6 for <code>try</code>/<code>finally</code>): |
Thus, to read a PPM, convert it to grayscale, and write it back out again becomes this (which requires Tcl 8.6 for <code>try</code>/<code>finally</code>); the PPM reader and writer are inlined because they are trivial at the script level: |
||
<lang tcl>package require Tk |
<lang tcl>package require Tk |
||