Skip to content
Snippets Groups Projects
Commit 5a6574ad authored by Antonio MATTAR's avatar Antonio MATTAR
Browse files

-fixed some bugs

parent 8c43b50f
Branches
No related tags found
No related merge requests found
0.png 0 → 100644
0.png

440 KiB

1.png 0 → 100644
1.png

373 KiB

2.png 0 → 100644
2.png

354 KiB

3.png 0 → 100644
3.png

276 KiB

4.png 0 → 100644
4.png

232 KiB

File deleted
File deleted
File deleted
File deleted
...@@ -48,24 +48,28 @@ def createAbsImage(terme): ...@@ -48,24 +48,28 @@ def createAbsImage(terme):
output = logic.getOutputFromAbs(terme) output = logic.getOutputFromAbs(terme)
im1 =createAlligator(input) im1 =createAlligator(input)
im2 = createImage(output) im2 = createImage(output)
im1 = im1.resize((max(im2.image.width, im1.width), max((int(im1.height * im2.image.width / im1.width),im1.height))) )
abstraction = Image.new('RGB', (max(im1.width, im2.image.width), im1.height + im2.image.height), (255, 255, 255)) abstraction = Image.new('RGB', (max(im1.width, im2.image.width), im1.height + im2.image.height), (255, 255, 255))
abstraction.paste(im1, ((max(im1.width, im2.image.width)-im1.width) // 2, 0)) abstraction.paste(im1, ((max(im1.width, im2.image.width)-im1.width) // 2, 0))
abstraction.paste(im2.image, ( 0 , im1.height)) abstraction.paste(im2.image, ( 0 , im1.height))
return abstraction return abstraction
def get_concat_h_multi_resize(im_list, resample=Image.Resampling.BICUBIC): def get_concat_h_multi_resize(im_list, resample=Image.BICUBIC):
max_height=max(im.height for im in im_list) max_height=max(im.height for im in im_list)
min_height = min(im.height for im in im_list) min_height = min(im.height for im in im_list)
max_width = sum(im.width for im in im_list)
min_width=min(im.width for im in im_list)
space_width=int(min_width*0.3)
total_init_width = sum(im.width for im in im_list) + space_width * (len(im_list) - 1)
im_list_resize = [im.resize((int(im.width * min_height / im.height), min_height), resample=resample) im_list_resize = [im.resize((int(im.width * min_height / im.height), min_height), resample=resample)
for im in im_list] for im in im_list]
min_width=min(im.width for im in im_list)
space_width=int(min_width*0.25)
total_width = sum(im.width for im in im_list_resize) + (len(im_list_resize) -1) * space_width total_width = sum(im.width for im in im_list_resize) + (len(im_list_resize) -1) * space_width
dst = Image.new('RGB', (total_width, min_height),(255,255,255)) dst = Image.new('RGB', (total_init_width, max_height),(255,255,255))
pos_x = 0 pos_x = 0
for im in im_list_resize: for im in im_list:
dst.paste(im, (pos_x, 0)) dst.paste(im, (pos_x, 0))
pos_x += im.width + space_width pos_x += im.width + space_width
return dst return dst
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment