Search code examples
imagemagickimagemagick-convert

How to draw a white L shape in the top-left corner using imagemagick


I have a image like below:

enter image description here

And I wanted to convert into something like below using imagemagick 6. How is that possible? I have gone through chop/shave/crop they all applicable to all sides symmetrically what I need is a partially chopped edges as below:

enter image description here

I have gone through https://www.imagemagick.org/Usage/crop/#chop but it helps to chop an entire edge/side but I need to remove edges partially.


Solution

  • You can achieve that by drawing a simple, white-filled polygon:

    magick start.png -fill white -draw "polygon 0,0 60,0 60,16 16,16, 16,60 0,60" result.png
    

    enter image description here