I want to do this pseudocode in a system without imagemagick but I have Matlab 2016a and Java in the system
convert 1.png 2.png +append result.png
Assume you want to concatenate in a loop like the following such that dimensions may not match. However, all objects 1,2,...,N have exactly the same dimensions. The following loop, however, concatenates two pictures at the same time, making the dimensions different with subsequent images: bigImage vs new image.
iterationCounter=1;
result=0;
while(iterationCounter < 3)
imgRGB=imread(filenamePng); % Images 1,2, ..., N have same dimensions.
if (result==0)
result=imgRGB;
end
% http://stackoverflow.com/a/35915990/54964
if (ismatrix(result(:,:,1)))
heightRatio=size(result,1)/size(imgRGB,1);
wantedSize=int16([size(result,1), size(imgRGB,2)*heightRatio]);
imgResized=imresize(imgRGB, wantedSize);
result=[result, imgResized];
end
iterationCounter=iterationCounter+1;
end
where output is an empty picture.
How can you do the horizontal appending of the images in Matlab/Java?