Skip to main content

Convert any binary data to a PNG image file and vice versa.

Project description

Run on Repl.it

What is PngBin?

The name PngBin comes from an image format file extension PNG (Portable Network Graphics) and the word Binary. An image produced by PngBin will have every property like a normal PNG image except that when viewed by an image viewer, It will appear broken and noisy (which is normal for any PngBin images). By utilizing the lossless data compression feature, A PNG image can be made to contain arbitrary binary data (this is why PngBin image can look noisy) without losing a single bit of information, Unlike JPEG image, which has lossy compression and cannot reverse its data to the original form.

apple noisy
Normal PNG Image PngBin Image Example

Why is PngBin?

There are a few fun applications I can think of while working on this project. One of which is you can make most image hosting act like a file hosting by loading your files (video, music, executable, pdf, etc.) or even images to a PNG image using PngBin, then upload those loaded images to the image hosting. This method uses the advantages of most image hosting, like direct link and high speed download, to access your file easier and faster than any average free file hosting. Or you can upload them to a site where posting arbitrary files is impossible and only images (especially PNG images) are allowed.

Visit these Jupyter notebooks for this application demo.

The possibility is there and it's up to you to decide. And of course, contribution is appreciated.

How is PngBin?

It's fine, thanks for asking. JK 😝
As mentioned above, In general, PngBin can load any data to a PNG image file which makes almost all of the images it produces look broken and noisy unlike normal PNG images which only allow a relatively small subset of binaries to be contained so that the image would make sense.

There are 2 main classes, Writer which converts any binary data to an PngBin image and Reader which does the opposite. These 2 classes also have their corresponding extensions EncryptWriter and DecryptReader, respectively. They are used to obscure/reveal data inside PngBin images with AES cipher. All the previously mentioned classes can convert a single image at a time which can be inconvenient in some cases, that's why ChainWriter and ChainReader are made to convert your data and split/join the images into/from multiple small images.

Requirements

  • Python 3.6+
  • cryptography (Write/Read Encrypted PngBin images)
  • flask, requests (WebUI)
  • httpx (Uploader)
  • jupyterlab (For running Jupyter notebooks)

Usage

Look for usage, examples and more details on Jupyter notebooks demo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PngBin-0.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PngBin-0.1.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file PngBin-0.1.0.tar.gz.

File metadata

  • Download URL: PngBin-0.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for PngBin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c242e0cfad3a5383507c4b2dbc1c2036e1f77c35b6184044d080b3b0a7585cb
MD5 a3f5e564ea9d9a6921a1595ed249ae6e
BLAKE2b-256 b40959be334b34a63e8ac70a46e840220f8fb185a54d35674d63db1a9b9e1318

See more details on using hashes here.

File details

Details for the file PngBin-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: PngBin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for PngBin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51c71e7970b0a135aa422cacbae180b4a1c6a1449f1080ef8091b7cc78f2c8d3
MD5 3acd9f90cefdd7ff76717bafb7a33007
BLAKE2b-256 225ff52fec544b210fa3438731eebfc5b01aea8c23d39ebb654a2e3bbc5d60ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page