11

Is there any feature in LaTeX to recolor a figure which is included in a LaTeX .tex file automatically like the feature which exists in programs like Word? It is a good feature, for instance the person has to bring different logos in his presentation slides and each are in different colors, by this feature he will be able to automatically recolor the logos to suite his presentation theme.

Before Recolor
enter image description here

After Recolor
enter image description here

7

2 Answers 2

19

Here is a possible solution for simple cases using blend mode (logo.png is your first B&W logo):

enter image description here

enter image description here

enter image description here

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}
  \node{\includegraphics{logo}};
\end{tikzpicture}

\begin{tikzpicture}
  \begin{scope}[blend group=lighten];
    \begin{scope}[blend group=difference]
      \node[inner sep=0,line width=0] (logo) {\includegraphics{logo}};
      \fill[black] (logo.south west) rectangle (logo.north east);
    \end{scope}
    \fill[orange] (logo.south west) rectangle (logo.north east);
  \end{scope}
\end{tikzpicture}
\begin{tikzpicture}
  \begin{scope}[blend group=lighten];
    \begin{scope}[blend group=difference]
      \node[inner sep=0,line width=0] (logo) {\includegraphics{logo}};
      \fill[black] (logo.south west) rectangle (logo.north east);
    \end{scope}
    \fill[blue!70] (logo.south west) rectangle (logo.north east);
  \end{scope}
\end{tikzpicture}
\end{document}
3
  • 3
    I was completely mind blown by this answer. After finding this question on the available blend groups, I started experimenting a bit. The multiply option was especially useful for me in combination with some color to tint a picture (with white bg) to my non-white background. Am I right, that everything inside a scope will be treated as defined by the blend group so if there is just one thing inside nothing would happen?
    – BadAtLaTeX
    Mar 13, 2019 at 17:32
  • 1
    @gr4nt3d Yes, you are absolutely right. Mar 13, 2019 at 23:15
  • 2
    This answer should triple count the votes
    – dEmigOd
    Sep 17, 2021 at 11:11
-3

No, it's not possible.

If you want to create a nice logo. You can use PowerPoint and have all its great capabilities. Save single slide as PDF and include the graphic with:

\begin{figure}[htb]
        \centering
        \includegraphics[width=\textwidth, trim=0cm 4cm 0cm 4cm,clip=true]{images/mylogo.pdf}
        \label{fig:mylogo}
\end{figure}

With the option trim you can easily crop the logo and delete white spaces. PDF is a great format, because you keep the lossless resize feature of PowerPoint.

PS: I am using MS Office, but LibreOffice should be just as well.

You must log in to answer this question.

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