| from PIL.Image import Resampling | |
| class doesthiswork2(Scene): | |
| def construct(self): | |
| vpixels = 40 | |
| svg = VGroup( | |
| Circle(), | |
| Text("Test") | |
| ) | |
| oheight = svg.height | |
| svg.scale_to_fit_height(8/(config.pixel_height/vpixels),scale_stroke=True) | |
| self.camera.capture_mobject(svg) | |
| image = self.camera.get_image() | |
| iobj = ImageMobject( | |
| image, | |
| resampling_algorithm=Resampling.NEAREST, | |
| ).scale(oheight/(8/(config.pixel_height/vpixels))) | |
| self.add(iobj) | |
| self.add(svg.scale_to_fit_height(oheight).shift(3*LEFT)) |