3

I have the below image. but I need to add this image in a different shape in a latex document. enter image description here

I draw the shape using Microsoft word and herewith I added the shape. Can anyone help me to create an image shape like shown below. enter image description here

Sabesan
  • 145

1 Answers1

4

If you have an image that you want to trim/clip in a way that leaves it as a convex polygon (as is the case with your example), you can turn/trim/clip the image successively via adjustbox's trim and clip options. It's tedious, but doable.

enter image description here

\documentclass{article}

\usepackage[export]{adjustbox} \usepackage{xcolor}

\begin{document}

\colorbox{green}{\includegraphics[width=10em]{example-image}}

\colorbox{green}{% \adjustbox{trim=35pt 0pt 18pt 37pt, clip}{% \adjustbox{angle=45}{% \adjustbox{trim=0pt 45pt 0pt 0pt, clip}{% \adjustbox{angle=-90}{% \adjustbox{trim=0pt 20pt 0pt 0pt, clip}{% \adjincludegraphics[width=10em,angle=-45]{example-image}% }% }% }% }% }% } \end{document}

The coloured boxes/background is just to show that the trimmed parts are transparent.

A Tikz path would be easier and more manageable, even for non-convex polygon trimming.

Werner
  • 603,163