I want to merge two pictures but I do not know how to find the cut location in y-axis by any Linux/Unix tools, but here ImageMagick as the first idea. Any approach is welcome: a programmatic solution or a method for solving the problem with manual assistance. Two pictures have joint similarity in y-axis, which I want to minimise and then merge for output. Pseudocode
- Find the y-axis location where the data is first time equal in both pictures.
- Minimise the y-axis equality of two pictures as long there is no equality between the pictures.
- Cut each picture by appropriate location. For top by percentages here,
convert -gravity SouthWest -crop 100x70%x+0+0 infile.jpg outfile.jpg. For bottom similarly,
convert -gravity NorthWest -crop 100x70%x+0+0 infile.jpg outfile.jpg.
- To merge correct parts of two images etc (here) by
convert -append A-edit.jpg B-edit.jpg output.png
Fig. 1 Image A, Fig. 2 Image B, Fig. 3 Expected output