Skip to content
Generate prime numbers whose binary representation looks like any image
HTML JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
BigInteger.min.js
README.md
index.html
prime_worker.js
screenshot1.png

README.md

primg

Inspired by this: Does there exist a prime number whose representation on a phone screen looks like a giraffe?

screenshot

Access it here https://geonnave.github.io/primg/.

Primg has made it to Hacker News' front page! :)

Update: now you can share URLs by appending the decimal number after the hash on the URL (you lose the image tough). For example, this is a prime dog: https://geonnave.github.io/primg/#179769313486231590772930519078902473361797697894230657273429661642538456588077306078196596037783249291026990862829670919205888565609581869739105202524725614169647793002230079727461396703734603105685474079081886809070115786113168328330817484522518138348888081075292599304124949646601273927687076353436639295493. Thanks for jchavannes and fovc from Hacker News for sharing ideas on this feature.

ToDo

  • find a way to update the DOM while doing heavy processing solved: Web Workers to the rescue
  • use a more clever way (maybe histograms stuff) to find the threshold number now using average of image
  • make it faster (currently takes minutes) "solved" by reducing canvas size from 50x50 to 32x32
  • make it prettier
  • make code cleaner
You can’t perform that action at this time.