0

I have a problem with python image processing.

  1. I have an image that is just a pattern.
  2. I have another image that will have a solid black line somewhere on it.
  3. I would like to replace the solid black line with the pattern.

I have looked at PIL and I have not been able to figure out how to do this, since it seems like the only way I can get the pattern out of the first image is to copy the image, and I can't figure out how to paste over only the black pixels.

Someone also recommended pythonmagick to me, but it doesn't have docs.

LJNielsenDk
  • 1,414
  • 1
  • 16
  • 32
Will Beddow
  • 70
  • 2
  • 11

1 Answers1

1

Using PIL, convert the white/black line into a mask which only allows to see through the black pixels, and use it to mask an image constructed by tiling the pattern image sufficient times in x/y to be large enough to cover the extent of the black line. See How do I generate circular thumbnails with PIL? for some highly useful answers.

Community
  • 1
  • 1