image2patch
image2patch splits the image in different patches with automatic detection of the best step in order to minimize pixels loss. The overlap between patches depends on the patch size.
Alternatively, it is possible to choose the step size.
The reconstruction of the original image is possible using patch2image which can merge the patches taking into account the overlap percentage among patches. Hence, the original image is perfectly restored.
If there is a minimum pixels loss during patching procedure, resize to its original dimensions is possible.
Example
Installation
pip install image2patch
from image2patch import image2patch
from image2patch import patch2image
How to use it
image2patch(image, patch_size, step=None, verbose=False)
In particular:
- image : 2D input image
- patch_size : dimension of the window
- step : the distance from one step to another, if =None it will be automatically detected in order to avoid pixels loss. If set = patch_size it will provide patches without overlapping but with pixels loss depending on the size of the input image.
- verbose : if =True it provides details.
patch2image(patched_image, original_dims, step, resize_flag = True)
In particular:
- patched_image : 2D input patches from image2patch
- original_dims : dimension of the original image
- step : step obtained from
image2patch - resize_flag : allows to resize the image to its original dimension in case of pixels loss.
Licence
Metadata
Release files for image2patch 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| image2patch-0.1.1.tar.gz | 6.2 kB | Without provenance | Details for image2patch-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| image2patch-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for image2patch-0.1.1-py3-none-any.whl |
Total release size: 12.8 kB
Release files / image2patch-0.1.1.tar.gz
| Download URL | image2patch-0.1.1.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d5d0fcec807c84f5315e25f08c994f63fb2d5a30b76c5571705397f252f1f87
|
|
BLAKE2b-256 checksum How to use checksums |
b32620c7b534c47dc53ddd4bbe3f20e38f754f36b1bcf71473cfbc28ae3aa63e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.3
|
Release files / image2patch-0.1.1-py3-none-any.whl
| Download URL | image2patch-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6934ba57b87ec6c0fff5e1639cce71dcf808d5829551fe50fc73f2c3081d2b3
|
|
BLAKE2b-256 checksum How to use checksums |
ddcf86419abace2540f856d5022ef06ef7af7d629c5685c82e5c26a75fe2882b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.3
|
Security for image2patch 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.