Creates a collage from images with OpenCV
pip install cv2-collage-v2
Tested against Windows 10 / Python 3.10 / Anaconda
How to use it
from cv2_collage_v2 import create_collage_v2
import os
import cv2
folder=r'C:\Users\hansc\Downloads\bd'
allpics =[]
for f in os.listdir(folder):
try:
allpics.append(cv2.imread(os.path.join(folder,f)))
except Exception as fe:
print(fe)
continue
collage=create_collage_v2(allpics,maxwidth = 1500,heightdiv=16,widthdiv=5,background=(0, 0, 0),save_path='e:\\nyhctest.png',)
cv2.imshow('Collage', collage)
cv2.waitKey(0)
cv2.destroyAllWindows()
Args:
lst (list|tuple): A list or tuple of images - allowed: [file paths, base64, bytes, PIL, urls, np.array].
maxwidth (int, optional): The maximum width of the collage. Defaults to 1080.
heightdiv (int, optional): The height division factor. Defaults to 6.
widthdiv (int, optional): The width division factor. Defaults to 2.
background (tuple, optional): The background color of the collage. Defaults to (0, 0, 0).
save_path (str|None, optional): The file path to save the collage. Defaults to None.
Returns:
np.array: A NumPy array representing the collage image.
Metadata
Release files for cv2-collage-v2 0.11
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 |
|---|---|---|---|---|
| cv2_collage_v2-0.11.tar.gz | 20.8 kB | Without provenance | Details for cv2_collage_v2-0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cv2_collage_v2-0.11-py3-none-any.whl | Python 3 | none | any | Details for cv2_collage_v2-0.11-py3-none-any.whl |
Total release size: 42.7 kB
Release files / cv2_collage_v2-0.11.tar.gz
| Download URL | cv2_collage_v2-0.11.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68819975f25370ba04f6ef7bf5762c5ea61cb2a8a5c5aa537fb62547b14066de
|
|
BLAKE2b-256 checksum How to use checksums |
4803338e2592cb17fc9b5c401f588fce71058b3f7e9cff7bdf7840190853ec35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / cv2_collage_v2-0.11-py3-none-any.whl
| Download URL | cv2_collage_v2-0.11-py3-none-any.whl |
|---|---|
| Size | 22.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd14155edf6da6a193df8df5922327a51c3b1c0fce96565ec909233739bd8005
|
|
BLAKE2b-256 checksum How to use checksums |
534ed7187db5a1323b42b2e227afb04b35e96e97471772a1647790824350b9d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for cv2-collage-v2 0.11
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.