Fix dark output bug

pull/21/head
Kohaku-Blueleaf 2023-01-21 22:26:41 +08:00
parent 31122529ed
commit c743bd8028
2 changed files with 4 additions and 3 deletions

View File

@ -29,9 +29,9 @@ def run(img, u, d, l, r, mode='fill'):
new_img.paste(img.resize((w, d), box=(0, h, w, h)), box=(l, u+h))
if l:
new_img.paste(new_img.resize((l, h_n), box=(l, 0, l, h_n)), box=(0, 0))
new_img.paste(new_img.resize((l, h_n), box=(l+1, 0, l+1, h_n)), box=(0, 0))
if r:
new_img.paste(new_img.resize((r, h_n), box=(w+l, 0, w+l, h_n)), box=(l+w, 0))
new_img.paste(new_img.resize((r, h_n), box=(w+l-1, 0, w+l-1, h_n)), box=(l+w, 0))
return new_img, mask, f'{w_n} x {h_n}'
@ -39,7 +39,7 @@ def run(img, u, d, l, r, mode='fill'):
if __name__ == '__main__':
img = Image.open('./01491-2023-01-21_d7ff2a1d60_KBlueLeaf_KBlueLeaf_856221927-768x512.png')
new, mask = run(np.array(img), 64, 192, 64, 64)
new, mask, _ = run(np.array(img), 64, 192, 64, 64)
w, h = new.size

View File

@ -222,6 +222,7 @@ def add_tab():
#
image_out.change(lambda x:f'{x.width} x {x.height}', image_out, res_info)
image_out.change(None, img_out_h_slider, _js=f'get_change_height("haku_out")')
#send
for btns, btn3, img_src in all_btns: