Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ken burns effect for wrong aspect-ratio pictures #158

Open
amondit opened this issue Oct 10, 2023 · 2 comments
Open

Improve ken burns effect for wrong aspect-ratio pictures #158

amondit opened this issue Oct 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@amondit
Copy link

amondit commented Oct 10, 2023

Hello,

Thanks again for having integrated the Ken Burns effect on pictures, it looks great and makes my HA dashboard look awesome while in simulated-screensaver mode!

One minor nitpick I have is that, for some pictures that are not in the right orientation (pictures in portrait displayed on a landscape dashboard, for example), they obviously get cropped (and sometimes not nicely, like faces being cut out, or unnecessary details get focused on), and that the ken burns effect could help with that if we could get it to 'pan' across the picture (instead of just select a part of the picture and zoom into it).

I know that's not an easy task to do, you might need to detect whether the picture is in landscape or portrait orientation and maybe adapt the css effect for it. However a quick search seems to get an example of someone that had the same kind of issue and managed to solve it by js/css: stackoverflow thread.

If you ever have some time to look into it it would be great :)

Thanks a lot!

@j-a-n
Copy link
Owner

j-a-n commented Nov 1, 2023

Did you try image_background: image (see: #149)?

@amondit
Copy link
Author

amondit commented Nov 7, 2023

Well, it's not so much that I may want to display the full uncropped picture (with blurred background around), but instead change how the "start" and "end" zones of the ken burns effect to adapt to the aspect ratio of the picture.
Kind of like this (how it's configured in iMovie):
image
but, right now, it seems like the "end" zone is always contained inside the "start" zone.
The idea would be to compute, based on the aspect ratio of the image and the aspect ratio of the display, how to do the animation. The problem is tackled in the stackoverflow post I linked earlier, but I don't know if any of the code in it could be applied here or not.

@j-a-n j-a-n added the enhancement New feature or request label Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants