Page 1 of 1

Filtration Residue

Posted: Thu Jul 22, 2010 6:04 pm
by smutley
I loved this challenge. I learnt so much more about the PNG format and I thought that the idea was brilliant. Kudos to teebee - it must have taken ages to create.

Posted: Sun Jul 25, 2010 6:41 pm
by teebee
Thanks, I am pleased that you enjoyed the challenge. To create the image I patched `pngtest.c' and `pngwutil.c' of the libpng library (http://www.libpng.org/pub/png/) which wasn't such difficult.

Using `pngcheck' and `perl' the challenge can be solved in one line as follows:

Code: Select all

pngcheck -vv residue.png | perl -ne 'if ($a) { $a = 0; push @a, map { $_ + 0 } split /\s+/, $1 if /^\s+((\d\s)*\d)/ } else { $a = 1 if /row filter/ } END { print"@a" }' | perl -lne 'BEGIN { %a = (0, "11", 1, "010", 2, "011", 3, "10", 4, "00") } $a .= join "", map { $a{$_+0} } split /\s+/; END { print map {chr} map { eval '"'"'$_ = 0b'"'"'.$_ } $a =~ /.{8}/g }'

Posted: Fri Sep 02, 2011 7:53 am
by bsguedes
teebee wrote:Thanks, I am pleased that you enjoyed the challenge. To create the image I patched `pngtest.c' and `pngwutil.c' of the libpng library (http://www.libpng.org/pub/png/) which wasn't such difficult.

Using `pngcheck' and `perl' the challenge can be solved in one line as follows:

Code: Select all

pngcheck -vv residue.png | perl -ne 'if ($a) { $a = 0; push @a, map { $_ + 0 } split /\s+/, $1 if /^\s+((\d\s)*\d)/ } else { $a = 1 if /row filter/ } END { print"@a" }' | perl -lne 'BEGIN { %a = (0, "11", 1, "010", 2, "011", 3, "10", 4, "00") } $a .= join "", map { $a{$_+0} } split /\s+/; END { print map {chr} map { eval '"'"'$_ = 0b'"'"'.$_ } $a =~ /.{8}/g }'

You still have to google the guy's last name to solve the challenge :D

Nice challenge, PNG images really offer a lot of possibilities to hide information in them.

Posted: Thu Sep 22, 2011 10:52 pm
by SnakeSnake
Of course after writing my own png reader with C/zlib I have to see here that pngcheck can display the filters too...

Anyway nice challenge I enjoyed it alot!

Posted: Mon Jun 25, 2012 4:51 pm
by AMindForeverVoyaging
Nice challenge. Why did it take me so long to stumble upon pngcheck ;)

Posted: Thu Jan 28, 2016 6:20 pm
by helly0d
Nice challenge. Nice one teebee.

Posted: Sat Jan 30, 2016 9:47 pm
by Hippo
helly0d wrote:Nice challenge. Nice one teebee.
Yep, definitely. This one was teaching.

Posted: Wed Aug 23, 2017 10:11 am
by Hckr
Awesome challenge teebee. It was as if you told a little story there.