Fir images. Converter was off-by-one
This commit is contained in:
parent
6f05476b9a
commit
f504eb3e60
|
@ -46,9 +46,13 @@ my $image = GD::Image->new($in);
|
||||||
my $w=$image->width;
|
my $w=$image->width;
|
||||||
my $h=$image->height;
|
my $h=$image->height;
|
||||||
|
|
||||||
|
if($verbose){
|
||||||
|
print STDERR "$in: ${w}x$h\n\n";
|
||||||
|
};
|
||||||
|
|
||||||
my @img;
|
my @img;
|
||||||
for my $y (0..$h){
|
for my $y (0..$h-1){
|
||||||
for my $x (0..$w){
|
for my $x (0..$w-1){
|
||||||
my $px= $image->getPixel($x,$y);
|
my $px= $image->getPixel($x,$y);
|
||||||
$img[$x][$y/8]|=$px<<(7-$y%8);
|
$img[$x][$y/8]|=$px<<(7-$y%8);
|
||||||
if($verbose){
|
if($verbose){
|
||||||
|
@ -62,10 +66,11 @@ for my $y (0..$h){
|
||||||
|
|
||||||
open(F,">",$out)||die "open: $!";
|
open(F,">",$out)||die "open: $!";
|
||||||
|
|
||||||
my $hb=int($h/8);
|
$|=1;
|
||||||
|
my $hb=int(($h-1)/8);
|
||||||
for my $y (0..$hb){
|
for my $y (0..$hb){
|
||||||
for my $x (0..$w){
|
for my $x (0..$w-1){
|
||||||
printf F "%c",$img[$w-$x][$hb-$y];
|
printf F "%c",$img[$w-$x-1][$hb-$y];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue