@@ -49,37 +49,38 @@ def reset_points(self):
49
49
50
50
51
51
class ImageMobject (AbstractImageMobject ):
52
- """ Displays an Image from a numpy array or a file.
53
-
54
- Examples
55
- --------
56
- .. manim:: ImageFromArray
57
- :save_last_frame:
58
-
59
- class ImageFromArray(Scene):
60
- def construct(self):
61
- image = ImageMobject(np.uint8([[0, 100, 30, 200],
62
- [255, 0, 5, 33]]))
63
- image.set_height(7)
64
- self.add(image)
65
-
66
- .. manim:: ImageFromFile
67
- :save_last_frame:
68
-
69
- class ImageFromFile(Scene):
70
- def construct(self):
71
- # Use PIL when you want to import an image from the web
72
- import requests
73
- from PIL import Image
74
- img = Image.open(requests.get("https://raw.githubusercontent.com/ManimCommunity/manim/master/logo/logoB.png",
75
- stream=True).raw)
76
- img_mobject = ImageMobject(img)
77
- # this line, when you want to import your Image on your machine
78
- # img_mobject = ImageMobject("<your image address>")
79
- img_mobject.scale(3)
80
- self.add(img_mobject)
81
-
52
+ """Displays an Image from a numpy array or a file.
53
+
54
+ Examples
55
+ --------
56
+ .. manim:: ImageFromArray
57
+ :save_last_frame:
58
+
59
+ class ImageFromArray(Scene):
60
+ def construct(self):
61
+ image = ImageMobject(np.uint8([[0, 100, 30, 200],
62
+ [255, 0, 5, 33]]))
63
+ image.set_height(7)
64
+ self.add(image)
65
+
66
+ .. manim:: ImageFromFile
67
+ :save_last_frame:
68
+
69
+ class ImageFromFile(Scene):
70
+ def construct(self):
71
+ # Use PIL when you want to import an image from the web
72
+ import requests
73
+ from PIL import Image
74
+ img = Image.open(requests.get("https://raw.githubusercontent.com/ManimCommunity/manim/master/logo/logoB.png",
75
+ stream=True).raw)
76
+ img_mobject = ImageMobject(img)
77
+ # this line, when you want to import your Image on your machine
78
+ # img_mobject = ImageMobject("<your image address>")
79
+ img_mobject.scale(3)
80
+ self.add(img_mobject)
81
+
82
82
"""
83
+
83
84
CONFIG = {
84
85
"invert" : False ,
85
86
"image_mode" : "RGBA" ,
0 commit comments