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)


(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:

    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

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).

  • 1
  • @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 ? – gr4nt3d 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 6: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? – gr4nt3d Jun 26 '17 at 23:06
  • 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

Your Answer

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

Browse other questions tagged or ask your own question.