I am using the tcolorbox LaTeX package to create some boxes with rounded corners. Everything works well when text goes in those boxes.

But I want to fill some of those boxes with just a picture (usually jpg format). Using \includegraphics inside the box indeed puts the picture in the box, but the rectangular picture does not have the rounded corners that I want. In other words, I want the corners of the picture to become rounded and not spill outside the box with rounded corners.

I would be grateful if someone can let me know how to do this. It would be nice to do so in tcolorbox, but I am also open to other solutions.


  • 4
    Welcome! Please provide us with a minimal working example (MWE) showing how you are including an image right now. You can use one of the standard images e.g. example-image-a or whatever from the mwe package to enable people to reproduce your framework easily. (You don't need to load the package - you can just use the images in it straight off.) Generally, though, you'll need to mask or clip the image using something like TikZ or pgfimage or another package with similar functionality. Depending on your configuration, you may be using something like this in tcolorbox already.
    – cfr
    Apr 5, 2016 at 0:56

2 Answers 2


Since tcolorbox is implemented using tikz, this is actually simpler.


\path[clip,draw,rounded corners=1.5cm] (0,0) rectangle (\wd0,\ht0);
\path (0.5\wd0,0.5\ht0) node[inner sep=0pt]{\usebox0};


  • 1
    That's a wonderful solution. Thank you so much! Apr 5, 2016 at 7:50
  • How can i remove the black path that is drawn around the image?
    – flymg
    Jul 7, 2022 at 17:06
  • The black edge is actually part of the image itself. You would have to make the rectangle smaller to remove the edges. Jul 7, 2022 at 17:25

watermark graphics is a tcolorbox option which uses graphics file as box background. If no text is desired inside upper or lower parts, height option fixes box size.


\begin{tcolorbox}[enhanced, watermark graphics=frog, watermark overzoom=1.0, title=example]

\begin{tcolorbox}[enhanced, watermark graphics=frog, watermark overzoom=1.0, notitle, height=5cm]

enter image description here

Another option could be to use clip upper option, which adjust upper part to interior size and form. In this case \includegraphics command forms the upper part. Following code is copied from page 166 in tcolorbox (v3.90) documentation.


right=0pt,boxrule=0.4pt,drop fuzzy shadow,clip upper,
center title,fonttitle=\small\sffamily,title=\detokenize{#2}]




enter image description here

update tcolorbox more recent versions include command tcbincludegraphics which combines an includegraphics command inside a tcolorbox. Therefore previous examples can be simplified. More information can be found in section 11 Inclusion of Boxed Image Files. Here you have some examples:


    size=tight, boxrule=1mm, arc=2mm, auto outer arc,

\tcbincludegraphics[width=.5\linewidth, graphics options={width=3cm}]{frog}
\tcbincludegraphics[width=.5\linewidth, hbox, graphics options={width=3cm}]{frog}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .