Bitmap/Read a PPM file: Difference between revisions

→‎{{header|Tcl}}: a few more notes
No edit summary
(→‎{{header|Tcl}}: a few more notes)
Line 425:
$image read $file -format ppm
}</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>); the PPM reader and writer are inlined because they are trivial at the script level:
<lang tcl>package require Tk
 
Anonymous user