I'm trying to join multiple images together using pyvips, but during the process the width of the image more than doubles, and I can't seem to figure out why
Here's the key part of my code:
files = ['small_images\\'+filename for filename in os.listdir('small_images')]
files = natsorted(files)
images = [pyvips.Image.new_from_file(filename, access="sequential") for filename in files]
[print(f'width: {image.width}, height: {image.height}') for image in images]
raster = pyvips.Image.arrayjoin(images,across=len(images))
print(f'raster width: {raster.width}, raster height: {raster.height}')
raster.write_to_file(f'rasters.png')
Expected output for 5 files should be:
width: 115, height: 1449
width: 44, height: 1449
width: 226, height: 1449
width: 74, height: 1449
width: 35, height: 1449
raster width: 494, raster height: 1449
But my actual output is:
width: 115, height: 1449
width: 44, height: 1449
width: 226, height: 1449
width: 74, height: 1449
width: 35, height: 1449
raster width: 1130, raster height: 1449
Images: https://i.stack.imgur.com/bCqPV.jpg
What's causing this?