manim icon indicating copy to clipboard operation
manim copied to clipboard

Image issues Tracking

Open MrDiver opened this issue 2 years ago • 1 comments

There are a lot of issues related to Images in Manim, this issue should keep all the important ones and the state of them in one place

  • [ ] #3146
  • [x] #3131
  • [x] #2979
  • [ ] #2412
  • [ ] #3113
  • [ ] #2924
  • [x] #2918
  • [ ] #2832

MrDiver avatar Dec 02 '23 12:12 MrDiver

Regarding the 3D rotation/movement/flipping issues:

The main problem is that the implementation of the Camera.display_image_mobject() method is incomplete:

  • It only resizes and rotates the image.
  • It does not shear the image or apply perspective to it. Therefore, it always looks rectangular and faces the camera, even when you 3D rotate it. Take a look at this TODO.
  • In facing the camera, the image always preserves its 2D orientation (clockwise - counterclockwise). Thus, flipping the image (i.e. rotating it 180° about the Y axis) does not work as expected. A proper flipping would also change the image's orientation, which is currently not happening.

At some point, I wanted to tackle this issue by rewriting Camera.display_image_mobject(). It seems we have to use the PIL.Image.Image.transform() method (instead of, say, .rotate() or .rescale()) to properly transform the image. This method would rotate, rescale and apply perspective, all at once.

However, after many attempts, I couldn't figure out how to properly use it. Therefore, if any of you has more expertise on this, feel free to give this issue a shot!

chopan050 avatar Jun 02 '25 20:06 chopan050