Grayscale image: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
Thundergnat (talk | contribs) m (Fix Perl 6 -> Raku links) |
||
Line 1,517:
=={{header|Raku}}==
(formerly Perl 6)
This script expects to be fed a P6 .ppm file name at the command line. It will convert it to grey scale and save it as a binary portable grey map (P5 .pgm) file.
<lang perl6>sub MAIN ($filename = 'default.ppm') {
Line 1,537 ⟶ 1,538:
$out.close;
}</lang>
Using the .ppm file from the [[Bitmap/Write a PPM file#
Original: [[File:Ppm-perl6.png]] Grey Scale: [[File:Pgm-g2-perl6.png]]
|