static PatchworkImage patchworkBufferedImagesHorizontally(LPair images, O... _) {
if (empty(images)) null;
optPar int spacing = imageMergeSpacing();
int w = intSum(mapMethod getWidth(images))+(l(images)-1)*spacing, h = intMax(mapMethod getHeight(images));
new PatchworkImage out;
int x = 0;
for (imageAndValue : images) {
BufferedImage img = imageAndValue.a;
int y = (h-img.getHeight())/2;
out.addPatch(img, x, y, imageAndValue.p);
x += img.getWidth() + spacing;
}
ret out;
}