EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group

 

Affiliates



The Urinal

hackhound.org

suck-o.com

hack.org.za

flyninja.net

 

Enigma Group's Code Bank


Image to ASCII

By: winkleer  -  Date Submitted: 2008-12-01 07:45:44

  1. <font color="black" size="0.1px" style="line-height: 0.1px;">
  2. <pre>
  3. <?php
  4.  
  5. // Simple image to ASCII by winkleer
  6.  
  7. function error()
  8. {
  9. die(" <br />\nERROR. <br />\n");
  10. }
  11.  
  12.  
  13. $image = "moo.jpg"; // image here, in same dir
  14.  
  15. $info = getimagesize($image);
  16.  
  17. if($info==false)
  18. {
  19. error();
  20. }
  21.  
  22. $x1=$info[0];
  23. $y1=$info[1];
  24.  
  25. if($x1+$y1>5000) // too big m8
  26. {
  27. error();
  28. }
  29.  
  30.  
  31. $im = fopen($image, "r");
  32.  
  33. while($foo=fgets($im))
  34. {
  35. $imagedata.=$foo;
  36. }
  37. // echo $im;
  38.  
  39. fclose($im);
  40.  
  41. // echo $imagedata;
  42. $imagedata=imagecreatefromstring($imagedata);
  43.  
  44. if($imagedata==false)
  45. {
  46. error();
  47. }
  48.  
  49.  
  50. $y=0;
  51. while($y<$y1)
  52. {
  53. $x=0;
  54.  
  55. while($x<$x1)
  56. {
  57.  
  58. $rgb = imagecolorat($imagedata, $x, $y);
  59. $rgb = imagecolorsforindex($imagedata, $rgb);
  60.  
  61. $total = $rgb['red']+$rgb['green']+$rgb['blue'];
  62.  
  63. if($total <= 100)
  64. {
  65. echo chr(35); // #
  66. }
  67. elseif($total <= 250)
  68. {
  69. echo chr(37);
  70. }
  71. elseif($total <= 350)
  72. {
  73. echo chr(63);
  74. }
  75. elseif($total <= 450)
  76. {
  77. echo chr(42);
  78. }
  79. elseif($total > 450)
  80. {
  81. echo" ";
  82. }
  83.  
  84. // echo $rgb['red']." ".$rgb['green']." ".$rgb['blue']." <br />\n";
  85.  
  86. $x++;
  87.  
  88. }
  89. echo " <br />\n";
  90.  
  91. $y++;
  92. }
  93.  
  94. ?>
  95. </pre>
  96. </font>
Return to php category list

Who Visited EnigmaGroup Today?

1581 Guests, 270 Users (182 Spiders)
Hessesian, whisperer, whoami, hackaday, limited, Rex_Mundi, trueorfalse, strudels, Bumpadjuppy, DrOptix, Klosse, InjectioN, blackknight911, Effomeidonize, Distorted, JohnMalkovitzch, TheHarrisonW, Obop, hkevin, ellisp, Vreality2007, advenlydent, zach, ddxc, suetekh, Vengeance987, m0rt, 2345, electro-technic, riesenjoe, IvanDimitriev, nmobin27, RomeoG, timetrust, 2142, 3ntr0py, BillTuer, advilapyday, lotato, lonely.connection, CloverCipher, vnd, aurena, rospark, valy1177, Blavatsky, learning, st3alth, Partisan, K0gller, fitz, Jayjay, psychomarine, Vspectrum, San Marino, TinCardinal, brunoriversyhn, code-g, yshiau, Psiber_Syn, Seasharp, obencefoozy, SlayingDragons, Link-, tinuigimeni, jasonbourne, Fred, GothicLogic, somebody777, Meonkzt, CJ_Omaha, jearrorne, cls777, unsugsNashy, Balksnuntails, Sir D. Naut, batsbargy, Rik, Macabre, Nightraven, Iccyx, Repuhlsive, vipervince2002, Janomatrix, lol, veceattainc, techno, Exclaw, Nikhil, evjfvir967nj, Mod777, dark_void, nermtode, Tjm, bjy1997, hecky, saraf, elprof, damoniceht, trik, jordan86, SnoopSky, dan_movie, OnetInsolefon, darkfire1515, seojlhmyrhwh, Thoplehap, MaxMeier, 1028rajeev, Abhinav2107, autotuneuser, alexelixir, Tauya, Jozinbrejl, kernel_mod, quolc, anandoump, vladavlada, Taicadine, AnnaNoult, GreenTiger, baripadatimes, Ewing, Blackbeard, thepuppeteer, BON-SELE, hak4r, Unotohumsmush, NIGHTWOLF, m4f10, avacraft, becool, thecoder, n01se, alpha1, saki, ObesseJew, ActictGlync, sajan, unicornrainbow, Domihoolbob, matt.14, max66, SnowFury, Spud101, myfabregas, Ausome1, kajman121, Frudopvia, ideveloper6, OLOLO, Bugshuppy, lamb, VagWirura, LialiTiTviors, Ordeptpen, scifics, Pozycj-Z21, Gkjt, interPuscruse, aaftab, TheCheeseDemon, blackcyxx21, jollyjimbo, N4g4c3N, rineDriekly, Rap70r, Xargos, flarornEral, ovetz13, sonu sahu, Breezy, emitleBen, Hackpad, JWTSR, nicyun, kaizo, itevainee, luke460, AverageJoe, zeratu92, litbk, Mr.Pickle, mannavard1611, LoopyLion, NexusVos, mtroscheck, burberrybagsjr, nikedunksxm, xordux, jeho, Lonewolf034, Dragonite, nhorton, Reloaded, Odile, Kaptain_k1rk, Teefelltugh, grizzly, posthuman01, jakesboy2, pwnpwnlolz, Sabo, Lakhoamnmek, Røgue, dot_Cipher, mori, snickerless1, cart1m, Xendz, KELATALFTUS, hubris, Afrika, welepocourl, carpinteyrofbt, ReottphoffBom, Reahastegah, pumashoesld, pdanielt, dmac006, DnA-Ender, Red Fox, couptupleakb, ryanjcrook, iMaxx, sh3llcod3, TimHortons, EmilaHapsaums, Feld Grau, burgeoningneophyte, Maroonhat, CookieAu, tinkansinar, Mitodina, timberlandoutletlufc, zsefvy, guccioutletox, AlexDiru, AbercrombieFitchhl, Ryuske, r0z4, slchill, kalak55, Ph4Kt480ii, beefarn, Jigoku, WrossyJes, pollolololo, ZepSung, Fragility, jell0, C9019, Othrguy, Noticon, KIKNWING, llasarus, mdubz, leah027, iellswo, MAZI_, Estilaamoli, subtentar, Trollorful, no, nas0151, Traybo, howisthechicken, thethird3y3, Somethingclever, marplusz
 
Enigma Group