agriz wrote:Sir in the above code, how can i use composite before deleting the ( img.jpg -crop 100x100 )?
First -delete1 will not remove ( img.jpg -crop 100x100 ), it will remove ( -clone 1 ). Image indices start at 0 not 1.
Second I am not sure what you are trying to composite. You cannot use -composite for more than two images at a time as I mentioned earlier. But you can flatten them all.
Why do you need the clones? ( img.jpg -crop 100x100 ) will make many smaller 100x100 images and will have automatically remove img.jpg. By cloning each one, you are making twice as many 100x100 subsections.
Have you tried
Code: Select all
convert -size 400x400 xc:none ( img.jpg -crop 100x100 ) -background none -flatten result.png
Does that do what you want?
Is img.jpg larger than 400x400? If so, you will be trying to put all the 100x100 pieces back over the 400x400 image in the places they were cropped and this will not fit the 400x400 transparent image.
Perhaps you should explain in more detail and show img.jpg so we can understand what it is you are trying to do.