0

I am aware of the existence of the package wrapfig and features to shape text more sophisticatedly (also this). My question aims for some advanced tool to be used with them:

Is there a workflow to have shapes in images recognized ?

(1) compare comments and edit

Afterwards, how do I make this information accessible in LaTeX ?

Ultimately I would like to have pictures with white or transparent areas as background. The lesser requirements to the 'background'-part in the image do it, the better.

These edges should be detected and be made available in some way (eg. TikZ-nodes).

An obvious usage would be to have text flow around the content of an image nicely - imagine eg. a product shot of a lamp on the right of ones text. (1)


edit:

(1) After looking at pullquotes (mentioned in the comments by Torbjørn T.) I must say it seems to be covering all needs with picture inserts. Apparently it is using ImageMagick's edge-detection:

  [...]
  \edef\@tmp
  {%
    convert \img@pq\space -resize \strip@pt\@tempdima x\strip@pt\@tempdimb! -bordercolor white -border 10x10 -morphology Erode Disk:10.3 -resize
    \number\objrows@pq x\number\objlines@pq! -black-threshold
    95\@percentchar\space-monochrome \img@pq.pqshape.txt
  }%
  \immediate\write18{\@tmp}%
  [...]

However, it is still unclear to me how this data is passed on to LaTeX and if this can be used in other ways (eg. TikZ-nodes).

BadAtLaTeX
  • 1,139
  • 1
    Related: https://tex.stackexchange.com/questions/53073/two-column-text-with-circular-insert/70169#70169 https://tex.stackexchange.com/questions/45958/implementing-a-pullquotes-algorithm-in-latex – Torbjørn T. Jun 24 '17 at 21:47
  • @TorbjørnT. thanks for this lightning quick comment.pullquotes looks very interesting! It probably covers any text-flow wish. I have not yet read all of the content, but off the top of my head this questions strikes: Does this integrate with eg. TikZ such that I could work further with the shape inside LaTeX ? – BadAtLaTeX Jun 24 '17 at 22:01
  • I don't think so. The (experimental) feature that recognizes the shape uses ImageMagick, so it must be an image format that ImageMagick knows about. – Torbjørn T. Jun 25 '17 at 06:47
  • @TorbjørnT. don't get me wrong, I was referring to the means provided by the package. So lets say I have a .png and it detected some edges; how does it tell LaTeX about it? Could one retrieve nodes for a TikZ Image from this detection? – BadAtLaTeX Jun 26 '17 at 23:06
  • I really don't know much more than that those two posts I linked to exist, and you can read those just as well as I can. – Torbjørn T. Jun 27 '17 at 06:31
  • Alright, I just thought you might have some more insight. The reason why I was asking is, that I could only find this line convert \img@pq\space [...] -bordercolor white -border 10x10 [...] but am unable to determine how it's then passed to (La)TeX; obviously it's not using TikZ-nodes at that point. Thank you for pointing out these related posts though! – BadAtLaTeX Jun 27 '17 at 07:09
  • 1
    The information from convert is stored in, I think, pq-duck.pdf.pqshape.txt, for example. This specifies, I think, what is essentially a kind of mask for the image. (Not exactly a mask, but more like a mask without holes.) But what do you want to turn it into TikZ nodes for? – cfr Jun 27 '17 at 22:40
  • @cfr, well as the text-flow problem is solved, I would say: -having text flow along edges; -basis for annotating dynamically (so not in some external program); -just generally being well accessible. The question is purposely broad, because I might use it as a basis for some follow-ups. Hence, the information and a general idea like how to translate the information from the file you mentioned to TikZ nodes is absolutely satisfactory for me as an answer. – BadAtLaTeX Jun 28 '17 at 10:26

0 Answers0