10

I'm working on wedding invitations and there's a logo that identifies the braid and the broom. Originally this was taken from the internet in a low resolution and quality that ruins up the overall aspect of the invitation. I'd like to draw this complex figure using Tikz, which I show below:

Logo

As you can see, the quality of the picture isn't very high and is going to look worse when it gets printed out.

There are a couple of open flanks on which I'd need some advice, to say:

Contour of the heart:

I'd like the heart to look just like the one located on the lower right corner of the following image: http://1.bp.blogspot.com/-BDWeR0RCqfU/Tec8AcrN6MI/AAAAAAAAFDw/CsikMUj4PYI/s1600/HeartCurves_801.gif That means plotting a parametric equation. So far, I've been trying to plot the equation, but I don't find a way to plot such a function. Here is the code I've tried

 \documentclass[10pt,final]{article}
 \usepackage[utf8]{inputenc}
\usepackage[paperwidth=21cm, paperheight=10.5cm, top=4mm, left=8mm, right=8mm, bottom=4mm]{geometry}
\usepackage{fontspec}
\usepackage[german]{babel}
\usepackage{tikz}
\usepackage{graphicx}
\begin{document}
\begin{tikzpicture}[domain=0:4]
      \draw[->] (-3,0) -- (4.2,0) node[right] {$x$};
      \draw[->] (0,-3) -- (0,4.2) node[above] {$y$};
      \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
       \draw[scale=0.5,domain=-3:3,smooth,variable=\x,red]  plot ({2*cos(\x r)*cos(\x r)*cos(\x r)},{\x});
    \end{tikzpicture}
\end{document} 

The question here is how to plot the parametric function.

Branches:

I've wondering how to produce the lines representing the branches within the heart. I was considering to produce the lines using the classical control points, but I guess there must be better ways to produce them. Also, another problem that I see is to define the branches within the contour of the heart.

Leaves:

For the leaves I have a simple solution that uses the control points.

\documentclass[10pt,final]{article}
 \usepackage[utf8]{inputenc}
\usepackage[paperwidth=21cm, paperheight=10.5cm, top=4mm, left=8mm, right=8mm, bottom=4mm]{geometry}
\usepackage{fontspec}
\usepackage[german]{babel}
\usepackage{tikz}
\usepackage{graphicx}
\begin{document}
\begin{tikzpicture}[domain=0:4]
\fill [green](0,0) .. controls (1,1)   and (2,0.5).. (3,0);
\fill [green] (0,0) .. controls (1,-1)  and (2,-0.5).. (3,0);
\draw [green](-0.5,0)--(0,0);

    \end{tikzpicture}
\end{document} 

I could use the @Qrrbrbirlbel's answer (Use a custom shape as a "building block") as a base to define the leave as shapes, but the problem that arises here is to place the leaves at specific point of the branches at specific angles.

  • 5
    I may be wrong, but drawings such as those are tough to make with TikZ, by hand at least. There are routines to convert the images to TikZ that generate extensive code, but the final result is ok. I'm not sure how it's done you ask in the Chat, ask it or look it up I think you can get help. Though drawing it yourself will sure be a hard task! – Guilherme Zanotelli Nov 25 '16 at 17:09
  • 5
    Inkscape for example has tools for tracing bitmap images, and can export to TikZ code (might need a plugin, can't remember). (@GuilhermeZ.Santos) – Torbjørn T. Nov 25 '16 at 17:58
  • @TorbjørnT. I thought as much. But wasn't sure, so I let the more experienced users confirm. That's good info, thanks! :D – Guilherme Zanotelli Nov 25 '16 at 18:25
  • 1
    Related (and possibly a duplicate): Creating logo with fancy font – Werner Nov 25 '16 at 20:45
12

How to convert image to tikz using inkscape

  1. Open inkscape and import the image

  2. Select the image and use Trace Bitmap...

enter image description here

  1. For the image you posted I selected the following configuration:

enter image description here

  1. The resulting vectorised version of your image:

enter image description here

If the lines are not smooth enough or too smooth, these parameters can be adjusted in the trace options.

At this point I would simply save the vector image as .pdf and use it with \includegraphics.

  1. To convert the image to tikz, there exists and extension. [Be careful, the resulting file size may be huge]

enter image description here

  • Good to know it can all be done in one application. – Michael Palmer Nov 25 '16 at 20:43
  • @MichaelPalmer Also good to know that there is an alternative route, in case inkscape fails for whatever reason. – user36296 Nov 25 '16 at 20:51
8

Not a real answer - just a fake one to post this image, which was traced with potrace and polished a bit with inkscape

enter image description here

Dropbox link https://www.dropbox.com/sh/jk4wa9vcyeklqlg/AAAhva-i-pCASvhgLoI3v8Vba?dl=0

Edit: steps of the conversion

  1. Opened with Gimp, converted to grayscale, and then to black/white using the "threshold" tool

  2. Converted to pbm using imagemagick's convert (I assume Gimp could have done that, too)

  3. Traced with potrace -s picture.pbm

  4. Opened the svg file produced by potrace with inkscape and did a bit of manual tweaking of the contours.

  • 2
    +1, Nice man! Would you mind giving a more detailed description on how you did the conversion? Like what options (if any) of Potrace you used and what do you mean by "polished". I'm not so used to converting graphics and its a rather useful thing to have detailed. :D – Guilherme Zanotelli Nov 25 '16 at 18:45
  • 1
    Apperantly there this tool SVG2TikZ that can convert from SVG format to TikZ, that maybe helpful to the OP. – Guilherme Zanotelli Nov 25 '16 at 18:49
  • @Guilherme - see edited answer. As to converting to TikZ, I don't really see a need for that; instead, I would just save as pdf from inkscape and then use \includegraphics. – Michael Palmer Nov 25 '16 at 19:09
  • 1
    i don't too. It was only a suggestion. Meant for the OP. ;) thanks for the steps, that's very helpful! – Guilherme Zanotelli Nov 25 '16 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.