Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
You could use the -roll option, if the background is really a single color as illustrated. If it is a more complex image,
how are you going to know what is behind the small image that you move?
If you can separate the small image from the background (or if you originally have them as separate images), then
there are various ways of placing the small image on the large one. I usually use the "-draw" option but there are
other possibilities.
thank you for your reply! Sadly I've over smiplified the pictures. Let me show you an actual example:
As you can see the left half of the image is somehow a little bit too high (4 pixels higher than the right side). I want to move that part down, so that it will look like this:
GreenKoopa wrote:Did the left side get moved down 4 pixels, or is that a rotate?
Do you mean in the second picture? I've manually done that with an image editing program. But since I have a couple of hundred pictures that are like in the first image, I can't do that with every single one of them, for obvious reasons.
GreenKoopa wrote:For each image, do you know exactly what area you want moved and by how much? Is the background always transparent?
1 - read in file
2 - copy area to be moved
3 - erase area to be moved from background
4 - housekeeping
5 - paste area to new location
6 - write out file
This works fine, except for the white border at the bottom is now rolled to the top on one side. If the image was fully transparent background without the white strip at the bottom, this would have worked
Thus you need a more sophisticated routine to preserve the bottom area, crop the part you need moved, fill the area you cropped with transparency and then composite the cropped image shifted down by 4 pixels. see GreenKoopa's solution above.
Not regions actually separates a rectangle from the original image, modifies it, then composes it back on the original image. But does almost all that work behind the scenes making it easy to use.