0

pyvips を使用して複数の画像を結合しようとしていますが、処理中に画像の幅が 2 倍以上になり、その理由がわかりません

私のコードの重要な部分は次のとおりです。

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')

5 つのファイルの期待される出力は次のようになります。

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

しかし、私の実際の出力は次のとおりです。

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

画像: https://imgur.com/a/IDuRtIK

何が原因ですか?

4

1 に答える 1