Skip to main content
2 of 2
added 1 character in body; added 22 characters in body; added 2 characters in body; deleted 1 character in body
JMP
  • 4.6k
  • 17
  • 36
  • 45

Three may keep a secret, ... if two of them are dead.

Benjamin Franklin

It's a modified kite with a key on the line.

The JavaScript and C++ approaches turned out to be non-productive, but PHP image processing and GD worked like a charm.

Part 1

Part 2

No real hitches to report, just the usual string parsing routine.

Source 1:

<?php

$im = imagecreatefrompng("MBlXyTSp.png");

$c=0;$v=0;
for ($i=0;$i<480;$i++) {
for ($j=0;$j<640;$j++) {
$rgb = imagecolorat($im, $j, $i);
$r = ($rgb >> 16) & 0x1;
$v<<=1;
$v+=$r;
$c++;
if ($c>18 && ($c-18)%8==0) {echo chr($v);$v=0;}
$g = ($rgb >> 8) & 0x1;
$v<<=1;
$v+=$g;
$c++;
if ($c==2) echo '<br>';
if ($c>18 && ($c-18)%8==0) {echo chr($v);$v=0;}
$b = $rgb & 0x1;
$v<<=1;
$v+=$b;
$c++;
if ($c==18) {echo '<br>';$v=0;}
if ($c>18 && ($c-18)%8==0) {echo chr($v);$v=0;}
}

}
?>

Source 2:

<?php

$im = imagecreatefrompng("mCeETXDs.png");
$imo= imagecreatetruecolor(900,900);
$bl=imagecolorallocate($imo,100,200,100);

$c=0;$ox=-34;$oy=0;
for ($i=0;$i<480;$i++) {
for ($j=0;$j<640;$j++) {
$rgb = imagecolorat($im, $j, $i);

$r = ($rgb >> 16) & 0x1;
$ox++;if ($ox>899) {$ox=0;$oy++;}
if ($r) imagesetpixel($imo,$ox,$oy,$bl);
$c++;

$g = ($rgb >> 8) & 0x1;
$ox++;if ($ox>899) {$ox=0;$oy++;}
if ($g) imagesetpixel($imo,$ox,$oy,$bl);
$c++;

$b = $rgb & 0x1;
$ox++;if ($ox>899) {$ox=0;$oy++;}
if ($b) imagesetpixel($imo,$ox,$oy,$bl);
$c++;

}
}
header("Content-type: image/png");
imagepng($imo);
?>