git.shiar.nl
/
wormy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
parse-wormedit: convert pbm format to monochrome pnm
[wormy.git]
/
parse-wormedit
diff --git
a/parse-wormedit
b/parse-wormedit
index 721cec841e15a519862aae501dd8d7484550ec7c..cf1798d6a25e6cb787b9836577add8782ec93aed 100755
(executable)
--- a/
parse-wormedit
+++ b/
parse-wormedit
@@
-162,6
+162,10
@@
default {
my $img = Games::Wormy::Render->composite(
map { $data->{levels}->[$_] } @request
) or die "empty result for levels\n";
my $img = Games::Wormy::Render->composite(
map { $data->{levels}->[$_] } @request
) or die "empty result for levels\n";
+ if ($opt{format} ~~ 'pbm') {
+ $img = $img->to_paletted({make_colors => 'mono'});
+ $opt{format} = 'pnm';
+ }
$img->write(
$opt{output} ? (file => $opt{output}) : (fh => \*STDOUT),
type => $opt{format} // 'pnm',
$img->write(
$opt{output} ? (file => $opt{output}) : (fh => \*STDOUT),
type => $opt{format} // 'pnm',