Skip to content

Instantly share code, notes, and snippets.

@SqrtRyan
Created November 11, 2025 23:39
Show Gist options
  • Save SqrtRyan/b39deef309640cfa778298d26c058d81 to your computer and use it in GitHub Desktop.
Save SqrtRyan/b39deef309640cfa778298d26c058d81 to your computer and use it in GitHub Desktop.
NUM_COLS=5
ans = load_image_from_clipboard()
ans = split_tensor_into_regions(ans, 1, NUM_COLS)
ans = [crop_image_zeros(x,mask=x<250) for x in ans]
spacing_ratio=1/50
spacing=round(spacing_ratio*get_image_width(ans[0]))
ans = horizontally_concatenated_images(join_with_separator(ans,spacing))
ans=as_byte_image(ans)
mask=255-255*(as_grayscale_image(ans)==255)
mask=mask.astype(np.uint8)
ans=with_image_alpha(ans,np.minimum(get_image_alpha(ans),mask))
copy_image_to_clipboard(ans)
display_alpha_image(ans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment