From f504eb3e60a516199df985c4638253f4e71d1583 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 4 Aug 2011 23:39:16 +0200 Subject: [PATCH] Fir images. Converter was off-by-one --- tools/image/img2lcd.pl | 15 ++++++++++----- tools/image/lcd/i42.lcd | Bin 873 -> 864 bytes tools/image/lcd/r0ket.lcd | Bin 873 -> 864 bytes 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/image/img2lcd.pl b/tools/image/img2lcd.pl index 5f9fee1..d6738c6 100755 --- a/tools/image/img2lcd.pl +++ b/tools/image/img2lcd.pl @@ -46,9 +46,13 @@ my $image = GD::Image->new($in); my $w=$image->width; my $h=$image->height; +if($verbose){ + print STDERR "$in: ${w}x$h\n\n"; +}; + my @img; -for my $y (0..$h){ - for my $x (0..$w){ +for my $y (0..$h-1){ + for my $x (0..$w-1){ my $px= $image->getPixel($x,$y); $img[$x][$y/8]|=$px<<(7-$y%8); if($verbose){ @@ -62,10 +66,11 @@ for my $y (0..$h){ open(F,">",$out)||die "open: $!"; -my $hb=int($h/8); +$|=1; +my $hb=int(($h-1)/8); for my $y (0..$hb){ - for my $x (0..$w){ - printf F "%c",$img[$w-$x][$hb-$y]; + for my $x (0..$w-1){ + printf F "%c",$img[$w-$x-1][$hb-$y]; }; }; diff --git a/tools/image/lcd/i42.lcd b/tools/image/lcd/i42.lcd index f65a1da7fb63c37bd474572a62ae999d108dff0c..4fbf52446919c0b2d59ce756c92a86d8cb891244 100644 GIT binary patch delta 32 ncmaFK_JD0d%EYvkiKkO08!#qJo(ROB7!xOlFeOdi&a@E#>d6hg delta 36 rcmaFB_L6P#2d1=%DJc_=r%u*pOq|>e#IG5XCi^fYPhQ8giID*SCk+mg diff --git a/tools/image/lcd/r0ket.lcd b/tools/image/lcd/r0ket.lcd index 7ee229fb6d8301b16195e043e43270dc87c7e89b..b191e88ff8513eda299467e708ff8cb284147cce 100644 GIT binary patch delta 89 zcmaFK_JED?!$ijT$w`b#6I<*i2QW)c+`u{UDU`)E*`3iABFH^?C8G_D$;AX_PEKHQ ThY0abKF4GQVG2z)VKxN-hu