Myosotis-Researches 0.0.4__py3-none-any.whl → 0.0.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- myosotis_researches/CcGAN/__init__.py +0 -3
- myosotis_researches/CcGAN/utils/__init__.py +3 -0
- myosotis_researches/CcGAN/utils/concat_image_horizontal.py +29 -0
- myosotis_researches/CcGAN/utils/concat_image_vertical.py +29 -0
- {myosotis_researches-0.0.4.dist-info → myosotis_researches-0.0.6.dist-info}/METADATA +1 -1
- myosotis_researches-0.0.6.dist-info/RECORD +11 -0
- {myosotis_researches-0.0.4.dist-info → myosotis_researches-0.0.6.dist-info}/WHEEL +1 -1
- myosotis_researches-0.0.4.dist-info/RECORD +0 -8
- /myosotis_researches/CcGAN/{print_hdf5_structure.py → utils/print_hdf5_structure.py} +0 -0
- {myosotis_researches-0.0.4.dist-info → myosotis_researches-0.0.6.dist-info}/licenses/LICENSE +0 -0
- {myosotis_researches-0.0.4.dist-info → myosotis_researches-0.0.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
from PIL import Image
|
2
|
+
|
3
|
+
def concat_image_horizontal(img_list: list[Image], gap = 2) -> Image:
|
4
|
+
N = len(img_list)
|
5
|
+
|
6
|
+
# Error 1: no images
|
7
|
+
if N == 0:
|
8
|
+
raise ValueError("The length of the image list is 0.")
|
9
|
+
|
10
|
+
# Error 2: Size differs
|
11
|
+
width = img_list[0].width
|
12
|
+
height = img_list[0].height
|
13
|
+
for i in range(1, N):
|
14
|
+
if img_list[i].width != width:
|
15
|
+
raise ValueError("All images should have the same width.")
|
16
|
+
if img_list[i].height != height:
|
17
|
+
raise ValueError("All images should have the same height.")
|
18
|
+
|
19
|
+
# Create concated image
|
20
|
+
concated_width = width * N + gap * (N+1)
|
21
|
+
concated_height = height * N + gap * 2
|
22
|
+
concated_image = Image.new("RGB", (concated_width, concated_height))
|
23
|
+
|
24
|
+
# Copy ans paste
|
25
|
+
for i in range(N):
|
26
|
+
concated_image.paste(img_list[i], (width * i + gap * (i+1), gap))
|
27
|
+
|
28
|
+
# return
|
29
|
+
return concated_image
|
@@ -0,0 +1,29 @@
|
|
1
|
+
from PIL import Image
|
2
|
+
|
3
|
+
def concat_image_horizontal(img_list: list[Image], gap = 2) -> Image:
|
4
|
+
N = len(img_list)
|
5
|
+
|
6
|
+
# Error 1: no images
|
7
|
+
if N == 0:
|
8
|
+
raise ValueError("The length of the image list is 0.")
|
9
|
+
|
10
|
+
# Error 2: Size differs
|
11
|
+
width = img_list[0].width
|
12
|
+
height = img_list[0].height
|
13
|
+
for i in range(1, N):
|
14
|
+
if img_list[i].width != width:
|
15
|
+
raise ValueError("All images should have the same width.")
|
16
|
+
if img_list[i].height != height:
|
17
|
+
raise ValueError("All images should have the same height.")
|
18
|
+
|
19
|
+
# Create concated image
|
20
|
+
concated_width = width * N + gap * 2
|
21
|
+
concated_height = height * N + gap * (N+1)
|
22
|
+
concated_image = Image.new("RGB", (concated_width, concated_height))
|
23
|
+
|
24
|
+
# Copy ans paste
|
25
|
+
for i in range(N):
|
26
|
+
concated_image.paste(img_list[i], (gap, height * i + gap * (i+1)))
|
27
|
+
|
28
|
+
# return
|
29
|
+
return concated_image
|
@@ -0,0 +1,11 @@
|
|
1
|
+
myosotis_researches/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
myosotis_researches/CcGAN/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
+
myosotis_researches/CcGAN/utils/__init__.py,sha256=pcVfIIeviGOfMzyyu9uOp5vAn4G3zzdcz5iyWbcdkUk,90
|
4
|
+
myosotis_researches/CcGAN/utils/concat_image_horizontal.py,sha256=iSh3RtyMJvHqu46KieHp15GeaLD6JNTF9zdM_Q0BmL8,919
|
5
|
+
myosotis_researches/CcGAN/utils/concat_image_vertical.py,sha256=xlIS8feNzS-K24mcHlKk8UpSmCp1u3hC2TI5ElfdTYI,920
|
6
|
+
myosotis_researches/CcGAN/utils/print_hdf5_structure.py,sha256=leaR8H3GhlX6EuIXDMh36xG2zBdV-XlJkaXBuoorl6I,320
|
7
|
+
myosotis_researches-0.0.6.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
8
|
+
myosotis_researches-0.0.6.dist-info/METADATA,sha256=QfDDgWZhk1VjL3HIzRA5gFBkeLXE7TVvZJJH_khkkb0,764
|
9
|
+
myosotis_researches-0.0.6.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
10
|
+
myosotis_researches-0.0.6.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
|
11
|
+
myosotis_researches-0.0.6.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
myosotis_researches/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
myosotis_researches/CcGAN/__init__.py,sha256=pcVfIIeviGOfMzyyu9uOp5vAn4G3zzdcz5iyWbcdkUk,90
|
3
|
-
myosotis_researches/CcGAN/print_hdf5_structure.py,sha256=leaR8H3GhlX6EuIXDMh36xG2zBdV-XlJkaXBuoorl6I,320
|
4
|
-
myosotis_researches-0.0.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
5
|
-
myosotis_researches-0.0.4.dist-info/METADATA,sha256=NlQ98UxtuQNQfB2l3OoLyjo-L2OAdzfPwDdOMh_okxQ,764
|
6
|
-
myosotis_researches-0.0.4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
7
|
-
myosotis_researches-0.0.4.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
|
8
|
-
myosotis_researches-0.0.4.dist-info/RECORD,,
|
File without changes
|
{myosotis_researches-0.0.4.dist-info → myosotis_researches-0.0.6.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|