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: | Line 1,517: | ||
=={{header|Raku}}== |
=={{header|Raku}}== |
||
(formerly Perl 6) |
(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. |
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') { |
<lang perl6>sub MAIN ($filename = 'default.ppm') { |
||
Line 1,537: | Line 1,538: | ||
$out.close; |
$out.close; |
||
}</lang> |
}</lang> |
||
Using the .ppm file from the [[Bitmap/Write a PPM file# |
Using the .ppm file from the [[Bitmap/Write a PPM file#Raku|Write a PPM file]] task: |
||
Original: [[File:Ppm-perl6.png]] Grey Scale: [[File:Pgm-g2-perl6.png]] |
Original: [[File:Ppm-perl6.png]] Grey Scale: [[File:Pgm-g2-perl6.png]] |