0

I have a GIF that I am trying to change all the white pixels to black. Not sure where to start.

Alternatively the GIF could be cropped to just the circle graphic on the left side of the GIF. I have used ffmpeg-python to crop the GIF down to a square around the circle but have yet to be able to crop it to a circle. ffmpeg.crop(stream, 46,117,390,390) Any insight is appreciated.

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
tcleckner
  • 13
  • 3
  • 1
    start with `cv2` (`opencv`) - it can read image as `numpy array` and in numpy array you can select all elements with value `(0,0,0)` (`black` color) and assign value `(255,255,255)` (`white` color) – furas Jun 28 '22 at 17:46
  • if you want to crop then you can use again `numpy array` to replace elements which are in range `x**2 + y** < r**2`. If you use `RGBA` instead of `RGB` then you can set `A` (transparency) to get rectangle with visible only elements inside circle. – furas Jun 28 '22 at 17:50
  • [python - What's the most simple way to crop a circle thumbnail from an image? - Stack Overflow](https://stackoverflow.com/questions/58543750/whats-the-most-simple-way-to-crop-a-circle-thumbnail-from-an-image) – furas Jun 28 '22 at 17:51

0 Answers0