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

Quality loss when resizing picture #246

Open
mel-mouk opened this issue Nov 26, 2023 · 0 comments
Open

Quality loss when resizing picture #246

mel-mouk opened this issue Nov 26, 2023 · 0 comments

Comments

@mel-mouk
Copy link

Hi,
I'm playing around with this library, and I stumble upon an issue.
When I try to resize pictures to make them smaller, they become very pixelated.
Not sure if it's an issue with the library or if I'm not using it properly.

Here's my code :

const params = {
        logo: "https://localhost:3000/logo.png",
	logoSize: { width: 1400, height: 510 },
}

const movie = new etro.Movie({ canvas });
movie.width = 1920 / 3;
movie.height = 1080 / 3;

const ratio = params.logoSize.width / params.logoSize.height;
const height = movie.height / 5;
const width = ratio * height;
const scene1Logo = new etro.layer.Image({
	startTime: 0,
	duration: 5,
	source: params.logo,
	x: (movie.width / 2) - (width / 2),
	y: (movie.height / 2)  - (height / 2),
	destWidth: width,
	destHeight: height,
});
movie.addLayer(scene1Logo);

And I get this result, despite my original image having a good quality :

Screenshot 2023-11-26 at 12 19 57

Can you help me ? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant