Save Raw Image Data As Image

2

1

So, being the curious person that I am, I opened a PNG image in Notepad. I got this:

‰PNG


IHDR         ‰
   sRGB ®Îé   gAMA  ±üa     pHYs  à  ÃÇo¨d  ÜIDAT8O­UMH[AþÞ‹Lý9•`¬bÞ9ääÁ›¥Jë¡ÁS©Äj«=‰Š’„@‰•x‘¢·„\<hÔ½hAŒ6øƒ ¤&Yš^^ÚC;ðØ·óÍ|3»3»+AEµwwwÏ‹ŠŠ^¤Ói³$IOiÔÒxI㹬^\\,¶µµÅ•î’R±½½ÍDr6ªËÑ?>>~jnnvçÚe '''厎}¤//P!rÊØu}}ý®µµõ'Ûdwwwí²,¿ÿKVª0‘:›šš²„{{{¯)©ÅÓÓSÌÏÏãááuuuÉ#ñù|Ðjµ˜žžFYYˆô
‘~•766žÇgö2H¥Rðûýp»Ý‚\)kkk˜™™A0„Édd"3IúÂ\rUUUM¬älfggÑØØ(Œ\.Ö×׳œ;;;˜ššóöövˆUfD/¸Âá°4]¹m2zzzF¡ÓéD¶¥¥¥èîîÆíí-ZZZ°°°€ââbå–™0JÚgJ„z½½½ ~[QRR‚ããcÔÖÖÂëõ¢²²R­@L˜ D«†nnn¢¯¯Ôo.//ÇÒÒjjjÔÌ…ŽK¨JÆàÉÉI–Œç÷÷÷Øßß/H–!¼T³à*Úl6uvvÂh4rk`bb‘H¤éwÎЯD9‹ÑÑQ‘Ùl$N§H$S‘0~ËÎÎÎ044$¹v»ÕÕÕp8âÿææV«UL!«r,[¦¥ü` £¿¿WWW¢]8+.DF¸]ÆÇÇÅôèè###H&“øœ¹4'I•ŒQs¿ÜÚÚ…¨¯¯ÇØØòVÅ:‡€³å#ª×ëyßZ,–п²'eeåã9Š”þc_(Àß×—5£Î»÷B¡Ð+ZÊÜ?_°¹O€%ó
÷l˜¾‚OÀ//ChæèE    IEND®B`‚

I was perusing Skype's database file when i came across a similar chunk of stuff:

    ‰PNG


IHDR   B   ,   Ѫn   tEXtSoftware Adobe ImageReadyqÉe<  ÍIDATxÚìZilTU>3¥ÓuXJÄŽ”¸Ä¥…é:Õ_ÄÀ`¢ )ü hŒ-þ©‰ ˜ ˜`B]0ÈP5è,ÅàBT¤XAQè”Ú*Ò23µNçÍò<çÎ{íé{ÓyC;´Ø“œy·÷m÷~÷,ß¹¯:QaB ôL 1„’èRºËé)cÇÊI§Ò1ÈtÄ1F ø»Õ*õxQ·  uÿ œž
ü=¦rÖŽ`Ôg ´Äˆêçv÷aÐp­-Á¹Â´µcÞr<äˆvëQé6»U3cEjŸši´! ÍØ~õ£´§OGiH_Å#õàK“5”–N5ØŽ<
§ÏY¸z¶év_@ÝŽ:3m@œê

ékêC0Ùi²†­Ï™YãÑ)8´$.,Ï]°ýÎÌÚ™};v7Ð5¨ËP‹F%kdâýÂË=”
VãàmëÎöAoHlëZi3šY­¡ ›-¡
kF†Ê¨Ov†àøµ [—/®¾H˜ÖJ:}µ›.CýÕŸRŒ@^ÂC¹ýŒ
³¢†ÔÚ‘O¯Mƒ5lª½7S„‚fÒ²i¦²„EÈ@PJ
½‘’îˆ`Ÿû¸=H€ì•2a8BEi²*®·9ĺQ…ÀéÉÁßvïÊüü|cìëÿB3ZÀgh  ´0›ç™áEÔ\ƒúÔÜ\õ¯ý°·%°-bcb‹pzÈfˆD•¢¥.œjÒõt   ±äfŠIWy#Ê8[%ýJ§u¡plšk côGD¨½€ŽþsÕÃ@¯"»þÀ> [ç›)ˆ+
¹‚àÆæk‰ƒ¥ÓC«îA=HƒyÂÅY¹|æ ö»‹³ò8.Q&™›ŸQ3BÖ0™É¹Ñ÷¢ßÃçÿaÅ7>¸âÃ#4ßZdaîŠv.´À‡
 5Ùï
Ða=ê5e È
œžƒjLñ½«Tß“9H5±M}ªL4ú¬›•·—O7-ÈÍ€­¸Ò?ûac“ÖÁ<€Üâý6šÿ
³X±¡È/œ÷+>-Žvcó¨rúŒºB£dŠBþ([‚lrŸšI %_^‹zà•‹~ö¾¿pµ·ýÒ-˜f[ô,Xn@pBhï¸ÅÃCǶ¿…-Ü6eáôØ$lñªúî̘v`Y;ǛѩSp Y–M5t*‚Z«[ÌÃß٨ƸÚ׃ñ©3@šCqž¾½?¦ˆEù,. pðò]f؇«ÿ{ï ‹œÀþ‹=áؼ8HVÝaÇœX6Y‡&hÃR€¢vÌŒñÚ§LyŠ–AïÐÆ›qî2YÆús~æ2yÊ‘¦›uŒø­ý±Î¸CPƒ‹…©Ÿ]ßÐÉ,¤A™P9=nAÕŽ"    ñJ%û©$-‚ÆÖ‚ú*êw˜êÜH¬,Ø~†jÔ\ùRâ³ÐMhÎw‡cs°$‹yIcœõ†—`×Ùø¢‹€¸ÛØ;Œš$²YÀÔKò€¹ºƒ(4Z0ÜË0íÃÎb8~ê#P—¢¶Åq«ö,)£«$*ߟE
 `—TÊg”xKB!îSÕ̲H
Ÿ2S.ºFXÊø†rìxõ‡aöhROHĨ“ø–I¯Ì()“ ’Ž) ø/%@ŠÉA’¸_ž1çºFˆˆTPu¿ ¸aŽáÃ)íPÉÙA
á&)(aʶ\F¬ÜV ²”·?ÐðAºžÝƒÙu>&c³!¹Ò×)qnY®*W§*”¾<_zº70¢YÅé9Ç¥ò]Té'³Õ¦ —¥ã÷#¾1#[M”+ÁÙ¤ãIQJãø‘1G‚ÉŽ˜hbÇoýràâÃÐm^(õí‘xÅ`9¯ÌgÒ²1œG(ÅÞä)6𱂮¥{†q‹VL‰Eq¥~¡„†~6°£EÔ6ª1‚ÊÚÆÇrb€àÍ¿
k
ª-Hî?ÙÃÀ PVÍ0Æ€£„,•“¼ 2‰ÚÃí ³úp”†<  àAˆ7ýR.S”M3Lœ\GÞÊÓ,Q`–ÞŠžôˆ›¼±+̧L²>ŽIrrúŽAo-
Åêw­Ècíñ&š¾tÑ„ãÉ“$yÎd†|Ȩf\ãÚ"´H "úœîë@ÈÜ>Ù¤{ÃSvt_zY©M{Ñgò|¡~¬º†]ŠØt;=6·ÖoÁÒ5ß íÓ}D¹âOâžYÏhrtËß‹}Mcˆÿà±çr ÕçZRcÝm‘5nw™ "
@Ü7Äàf˸‘ÿ 3Ét}Xå    IEND®B`‚

They look similar enough - and most importantly, both start with ‰PNG. So, i tried putting it into notepad and saving it as a PNG file. (with ANSI encoding, fyi.) When i tried to open it - nada. File Corrupted, says Windows. So, my question: how to i get that rawness whatever into an actual image? is it not ANSI encoding? or is there a program that will do this for me?

Thomas Shields

Posted 2011-05-15T00:13:52.783

Reputation: 393

Answers

1

Notepad will often corrupt binary files, as it is only intended to edit text files. Just open and save a good PNG file and you will afterward find it unreadable (messing with CR and LF characters, stopping at the first null byte, etc.). You may be interested in a hex editor. I have Frhed on my computer, but there are many alternatives. And you might want to read about the PNG file format so that you know, for example, where the beginning and end of the file are.

Did you know that automatic "file carving" programs exist? One such program is PhotoRec. You can drag your database file to that program and have it look for all the PNG files for you. The next step would be to run it on an old hard drive to find deleted files, which are only removed from the operating system's list of files and not actually erased until other files take their place. Your luck depends on how fragmented the files are, but it is likely you will find a lot (including cached web pages and old virus infections).

That, by the way, is why you should always not merely reformat but completely overwrite or destroy a computer's hard drive before disposing of it.

PleaseStand

Posted 2011-05-15T00:13:52.783

Reputation: 4 051

I'm checking out these apps now. Thanks for the detailed answer! if it works, i'm marking as answer. – Thomas Shields – 2011-05-15T01:08:31.607

No, this is how you destroy hard drives.

– Hello71 – 2011-05-17T21:40:02.000

2

It's not a real PNG file. Specifically, it does not contain an IEND chunk and there's a random string at the end. The only things it legitimately contains are an IHDR and IDAT block.

Hello71

Posted 2011-05-15T00:13:52.783

Reputation: 7 636

the "random string" was copied by accident, sorry. You think if i add an IEND chunk at the end it'll work? – Thomas Shields – 2011-05-15T00:52:44.153

@Thomas: I mean the "ui/images/678image/pnginformation" bit. – Hello71 – 2011-05-15T00:54:21.270

oh right. Okay, so, i kept looking and i found a chunk that had all the right stuff (IHDR, IDAT, and IEND). It didn't work when saving either. – Thomas Shields – 2011-05-15T00:56:01.343

0

Um, how about making a copy of the file you are interested in and renaming it so it has a .png extension.

On recent versions of Windows it should then open with the standard Windows Photo Viewer, just by double-clicking on it. Internet Explorer will probably open it too. There are a variety of viewers available if none of those work for you.

orcmid

Posted 2011-05-15T00:13:52.783

Reputation: 315

yeah, i tried that. I even said so in my question. "So, i tried putting it into notepad and saving it as a PNG file." – Thomas Shields – 2011-05-15T01:07:13.310

No, no, no. PNGs are binary. Reading one into Notepad will just make a mess.

Make a COPY of the file and RENAME it to have a .PNG extension. Don't use Notepad to make copies, use Windows to make a copy. (Just use copy and paste in the folder that the file is in and Windows will make a copy.) – orcmid – 2011-06-18T00:49:00.317

ah okay i see what you mean. – Thomas Shields – 2011-06-18T01:03:28.140