Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Adds inverting for ImageMobjects

Grant Sanderson7518ff286112
diff --git a/mobject/image_mobject.py b/mobject/image_mobject.py
index e4a74382d..09d5ed4b4 100644
--- a/mobject/image_mobject.py
+++ b/mobject/image_mobject.py
@@ -29,6 +29,8 @@ class ImageMobject(Mobject):
else:
self.pixel_array = np.array(filename_or_array)
self.change_to_rgba_array()
+ if self.invert:
+ self.pixel_array[:,:,:3] = 255-self.pixel_array[:,:,:3]
Mobject.__init__(self, **kwargs)
def change_to_rgba_array(self):