[Tex/LaTex] Colored frame in includegraphics environment

colorframedgraphics

I like using \includegraphics[<your options>,frame]{image}
to create a tight border around my images. How can I change the color of the border?

Minimal working example:

\documentclass[tikz]{standalone}
\usepackage[export]{adjustbox}
\begin{document}
\includegraphics[frame]{example-image-A}  
\end{document}

Example image with small tight border

Best Answer

Use adjustbox

\documentclass{article}
\usepackage{xcolor}
\usepackage[export]{adjustbox}
\begin{document}
  \includegraphics[width=2cm,cfbox=blue 1pt 1pt]{example-image}
\end{document}

enter image description here

How to use cfbox? This is from manual (of adjustbox):

enter image description here

With export option these keys become available to \includegraphics

Related Question