Skip to main content

To convert an image to HDF5 file format which can be then sent and converted back to any of the image format.

Project description

img_converter

This project was made more as a side project/hobby type. I do not really plan on updating or maintaining it, lol.

Well, it's not like someone's really going to be using it either way.

  • About

This was made to convert any image to HDF5 file format and then get the image back from any HDF5 file type. Just don't forget the dataset name :) (personal experience).

  • Working

It works in a simple manner - you import it, you use it. I mean what else do you expect from a python package? You think these 3-4 y/o or 70-80 y/o be doing all the setting ups? Nah mate.

  • You can convert the image to HDF5 file, something like this -

```python import img_h5_converter
converter = ImageConveter()

converter.image_to_array(/path/to/image, file_name, dataset_name)
```

Note :memo: : If no filename is provided it'll take image_data as one by default. And if no dataset_name is provided, the filename will be the dataset name too.

  • And you can convert .h5 files back to image files too -
    import img_h5_converter
    
    converter = ImageConverter()
    
    file = /path/to/HDF5_file
    
    converter.array_to_image(file, dataset_name, name_of_output_image)
    

Note :memo: : To check the image formats you can export in type this command -

print(converter.valid_formats())

  • Installation

You can download it using pip -

pip install img_h5_converter
OR

You can download the wheel file from github repo, and type in this command

pip install <path to wheel file>

Other Stuffs

Now, I know these all are pretty boring stuffs that no one wants to read (ofc me too). So I have kept it at last.

What was the motivation behind this, or simply - why?

Well, there wasn't really some great or revolutionary idea behind this. I had recently come to know about some called HDF5 file format (.h5). I was interested as what it was, why was it made.

So here's a short summary of what it is from the internet -

Hierarchical Data Format, Version 5 (HDF5) is a file format and library for storing and managing large amounts of complex data. HDF5 is open source and uses a file directory-like structure to organize data. It's designed to store scientific data and to make it easier to share with others. HDF5 files have a self-describing structure that makes it easy to navigate and find all the objects in the file. It supports a variety of data types, including atomic datatypes, which are indivisible objects like numbers or strings, and composite datatypes, which are made up of multiple atomic datatypes. Users can also define their own datatypes.

You can read more about it here. Or maybe here with a nice and clean experience.

But what does it meant to me?

Well, not much until a few days later a thought struck to my mind to share an image in the form of numpy array to my friend. But unfortunately, it was a .png image and numpy can't save 3-Dimenssional array to a text file. So that's when I begin to search and learn about HDF5 file format. And hence this.

I thought this could be a nice and fun little project. And maybe I could encrypt it and then share it to somebody? Lol it'd be fun nice experiment. I think I'll add this encryption thing in the near future.

Future Plans

I am considering adding encryption features to this project in the future. If you have any suggestions or contributions, feel free to reach out or contribute in the project!

So yeah that all thanks for reading!

PS: If you can write a better README.md for me, I'd be grateful :)

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

img_h5_converter-1.1.4.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

img_h5_converter-1.1.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file img_h5_converter-1.1.4.tar.gz.

File metadata

  • Download URL: img_h5_converter-1.1.4.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for img_h5_converter-1.1.4.tar.gz
Algorithm Hash digest
SHA256 ff571ee806c6addb42f2aa74034e64707b0f62bbaa802e97f56618de71e3aeb0
MD5 924e1fe65e97d93a1f2ad65b3166e5ea
BLAKE2b-256 2a30b594b18c53e8a71ffa406bd20b63f48beaa30717a7b71403e10965035214

See more details on using hashes here.

File details

Details for the file img_h5_converter-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for img_h5_converter-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cc61cec3119f0ae19b171a35091d2ee827dbc5968a67002a07f58ef28227a1de
MD5 d2e36ff1ab1d963facb08f988f7c1911
BLAKE2b-256 743ef992a7de555e7a6453c2faeec69c31aee77c171711efb690568525c57e53

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