0

I am trying to use a PNG image as repeating texture with TikZ, using the solution posted here.

By using a smaller texture than what the examples there seem to use, I noticed that this method produces lines at the edges of the texture (zoomed in):

This seems to be a result of interpolation and I want to get rid of it. I tried to explicitly disable it with

\pgfSetupImageAsPattern[width=3cm,interpolate=false]{wall}{smooth-wall-dark.png}

However, that did change nothing (not surprisingly, since interpolate is documented to be false by default). How do I disable interpolation here so that the texture does not have these lines? I am aware that this will make the texture more pixel-y.

7
  • This might actually be a viewer issue. Can you try different viewers? Feb 5 '19 at 20:42
  • Original image was macOS Preview. Adobe yields this, so you seem to be right, although I don't quite understand what's happening in Adobe (one tile suddenly has a darker color?!). Sadly, I tried this as workaround for my original issue, which was also about viewers being unreliable. sigh I probably need to expand the PNG graphic externally before including it to get rid of these issues.
    – flyx
    Feb 5 '19 at 20:56
  • Well, PDF viewers are always kind of hit and miss. Another thing you might be interested in is: How does it print? Do you see glitches in the printout? If yes, something has to be done. Feb 5 '19 at 21:03
  • Those fine lines and darker tiles probably depend on the zoom level. Does it change as you zoom in and out? Feb 5 '19 at 21:04
  • 2
    You could try rasterizing the PDF with 300 DPI and see if it's still bad, because that's roughly what a printer does. Feb 5 '19 at 22:37

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.