Skip to main content

Archive (encrypt) files and directories to image file

Project description

imageZIP

This is a small python package to archive (encrypt) files and directories into a single image file.

This project is made just for fun, it has no practical use, output "ZIP" image will always have the same or greater file size than it's content. Also, this is not easy-to-scan like QR codes.

Algorithm is pretty easy. If folder to zip is chosen, it will iterate through all folders and files inside it. If folder is found, it will write relative path of folder in bytes and add special folder delimiter at the end. If file is found, it will write it's relative path and name in bytes, add special file delimiter and then write all it's content in bytes with additional second file delimiter. When bytes array is ready to go, it will build an image, where individual pixels representing particular byte number.

Example

demo image

This is an "imageZIP archive", containing this whole "imageZIP" repository.

It was created with imageZIP.zip("some path/imageZIP/", scale=4).

You can actually download this image and unzip it with imageZIP.unzip("some path/demo_zip.png", scale=4), it will create "imageZIP" folder with all repository files.

How to use

To download this package, you can use pip install imageZIP.

Then go to python terminal and write import imageZIP.

Then you can use 2 available functions:

  • imageZIP.zip(path: str, scale: int = 1, color_mode: str = 'heat');
  • imageZIP.unzip(path: str, scale: int = 1, color_mode: str = 'heat').

Where:

  • path - path (str) to a single file or whole directory to "zip", or image file to "unzip";
  • scale* - scale (int) of input or output image file. Default: 1;
  • color_mode* - color mode (str) of input or output image file. Default: "heat".

*not necessary attributes, which can be omitted.

Notes:

  • For zip and unzip you have to provide same scale and color_mode settings;
  • Available color_modes are: bw, heat, heat_toxic, rainbow, red, blue;
  • scale is have to be int >= 1;
  • path can be absolute or relative;
  • If a good rectangle image can't be created, output image will be a square with some empty pixels at the end.

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

imageZIP-3.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

imageZIP-3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file imageZIP-3.tar.gz.

File metadata

  • Download URL: imageZIP-3.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

File hashes

Hashes for imageZIP-3.tar.gz
Algorithm Hash digest
SHA256 8ab295ed7c28495da0a51a2565e575df7ed28460a1a683db20eb13ada26e6c57
MD5 bc92ca9f584beaaa9f756413a121409a
BLAKE2b-256 676358f55a6d3dd0d7dfdb074316fa1fa5920415d11ae6190033c2d720b5ee1b

See more details on using hashes here.

File details

Details for the file imageZIP-3-py3-none-any.whl.

File metadata

  • Download URL: imageZIP-3-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

File hashes

Hashes for imageZIP-3-py3-none-any.whl
Algorithm Hash digest
SHA256 4d71b9f26ba9c7695dcbb3729458adcf7f61e959ee5be4f97dfba08822f8012f
MD5 6faeb5fcdde48b93b17a1ee9288311c6
BLAKE2b-256 b5a2ad8c3a6c5d7ff0828e7fe6657165cc310369bdc60d051473d301d652cd12

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