Skip to content

Commit d10c20d

Browse files
committed
Added a test for transparent images
1 parent e64ce7f commit d10c20d

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Binary file not shown.
284 Bytes
Loading

tests/test_graphical_units/test_img_and_svg.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,21 @@ def test_ImageMobject(scene):
252252
scene.wait(1)
253253

254254

255+
@frames_comparison
256+
def test_ImageTransparency(scene):
257+
file_path = get_svg_resource("translate.png")
258+
im1 = ImageMobject(file_path).scale(5)
259+
im2 = ImageMobject(file_path, invert=True).scale(5).shift(1 * LEFT + 2 * DOWN)
260+
im3 = ImageMobject(file_path).scale(5).shift(1 * RIGHT + 2 * UP)
261+
262+
im1.set_opacity(0.5)
263+
im2.set_opacity(0.5)
264+
im3.set_opacity(0.5).set_color(RED)
265+
266+
scene.add(im1, im2, im3)
267+
scene.wait()
268+
269+
255270
@frames_comparison
256271
def test_ImageInterpolation(scene):
257272
img = ImageMobject(

0 commit comments

Comments
 (0)