Fix paste mask argument so pasting a transparent image takes background.

Otherwise, the transparent background replaces the colored background.
This commit is contained in:
voussoir 2026-08-02 00:52:07 -07:00
parent 31b8047381
commit f8e8e7ec07

View file

@ -64,7 +64,7 @@ def stitch_argparse(args):
for (index_x, image) in enumerate(row): for (index_x, image) in enumerate(row):
pad_x = int((column_widths[index_x] - image.size[0]) / 2) pad_x = int((column_widths[index_x] - image.size[0]) / 2)
pad_y = int((row_heights[index_y] - image.size[1]) / 2) pad_y = int((row_heights[index_y] - image.size[1]) / 2)
final_image.paste(image, (offset_x + pad_x, offset_y + pad_y)) final_image.paste(image, (offset_x + pad_x, offset_y + pad_y), mask=image)
offset_x += column_widths[index_x] offset_x += column_widths[index_x]
offset_x += args.gap offset_x += args.gap
offset_y += row_heights[index_y] offset_y += row_heights[index_y]