I downloaded the left image. It consists of a chest with black space on the left, an area of shadow on the right and 5 'bands' making up the chest proper.
left edge, one band, center lock, another band, and right edge. A total of 7 thin vertical segments in the image
I gather you want to clone the two thin bands to make 3 of them, on each side of the center lock to generate the 'longer' chest shown in the right image?
The image with is 48 pixels wide, whcih does not divide well into 7 segments. Attempts to divide in 7 'near equal' segments does not divide the image nicely.
convert left.png -crop 7x1@ show:
Triming the left edge does make it divide up better, but right edge is not good.
convert left.png -trim -crop 6x1@ show:
So different tack... Using 'strip cropping' to extract 'slices' of the image
http://www.imagemagick.org/Usage/crop/#crop_strip
using a view I find positions to divide the image into 5 parts left, thin band, lock, thin band, and right
The each vertical segment start at x = 0, 11, 18, 27, 34 and are of widths 11, 7, 9, 7, 14 pixels
Here I divide the image into 5 and then re-append them to get original image
Code: Select all
convert left.png \
\( -clone 0 -crop 11x0+0+0 \) \
\( -clone 0 -crop 7x0+11+0 \) \
\( -clone 0 -crop 9x0+18+0 \) \
\( -clone 0 -crop 7x0+27+0 \) \
\( -clone 0 -crop 14x0+34+0 \) \
-delete 0 +repage +append show:
This duplicates the 2 thin 7 segment bands. -- effectively producing your second (right) image of an extended chest (image 76 pixels width)
Code: Select all
convert left.png \
\( -clone 0 -crop 11x0+0+0 \) \
\( -clone 0 -crop 7x0+11+0 -duplicate 2 \) \
\( -clone 0 -crop 9x0+18+0 \) \
\( -clone 0 -crop 7x0+27+0 -duplicate 2 \) \
\( -clone 0 -crop 14x0+34+0 \) \
-delete 0 +repage +append extended_chest.png
Adjust the duplication counts (adding 14 pixels over 2 bands for each extension) as desired.
There are probably other solutions, but I believe that is what you are looking for.