I want to remove a area from a image but I am not sure where to look at. Let me give you a example.
Destination:
So, I've removed 100x100 a area starting at 100x100 pixels. Could someone please guide me where to look at?
I think you want to paint a white rectangle on an image. So if you want a white rectangle 100px wide and 20px tall, offset 10px from the left side and 20px from the top, use:
magick input.png -fill white -draw "rectangle 10,20 110,40" result.png
So, if I use a 200x100 magenta input image, I get:
Following on from the comments, here is an example if you have an image with no existing transparency:
And to "punch a transparent hole" we create a new layer the same size as the image, filled with white then draw a black hole in it, and push the result into the transparency layer of the original:
magick image.png \( +clone -fill white -colorize 100% -fill black -draw "rectangle 20,10 300,40" \) -alpha off -compose copy-alpha -composite result.png
If the original image already has transparency which we don't want to replace entirely, but just modify with an extra hole, we can start from this image:
And proceed to extract the original alpha channel, modify it and push it back into the original:
magick image.png \( +clone -alpha extract -fill black -draw "rectangle 10,40 80,80" \) -alpha off -compose copyalpha -composite result.png