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

Maximum Scale Out to produce only complete image without any transparent parts added to result #595

Open
nrvikas opened this issue Jul 24, 2024 · 4 comments

Comments

@nrvikas
Copy link

nrvikas commented Jul 24, 2024

Hello!

We want to avoid a situation where the image can be scaled out to an extent where it starts producing transparent parts. We want the scale out to stop at the maximum point where the complete picture is present and never goes to capture out of bounds parts of an image. The following two screenshots might give more clarity.

Is this achievable ? If yes, would appreciate if anyone could provide any direction. If this is not supported, are there any other packages that has this feature ?

Many thanks.
Screenshot 2024-07-24 at 2 41 30 PM

Original Image
colourful-rainbow-spirals-ijgnlqquxz4soyqd

@nrvikas nrvikas changed the title Minimum Scale Out to produce complete image without transparent parts Maximum Scale Out to produce only complete image without any transparent parts added to result Jul 24, 2024
@sekoyo
Copy link
Owner

sekoyo commented Jul 24, 2024

I’m not sure what you mean since by default the whole image is seen, and if you scale above 1 then some will be out of bounds, below 1 and transparent areas will be seen. So the answer would be don’t scale it. Or do you mean the image itself contains transparency?

@nrvikas
Copy link
Author

nrvikas commented Jul 24, 2024

I’m not sure what you mean since by default the whole image is seen, and if you scale above 1 then some will be out of bounds, below 1 and transparent areas will be seen. So the answer would be don’t scale it. Or do you mean the image itself contains transparency?

Hi @sekoyo ,

Thanks so much for getting back - appreciate it. I think my original question was quite confusing. I have edited the question to add the original image.

Here is what we want to avoid... At scale 1 it is all good... until Scale 0.7 where image is smaller than Crop window and adds white edges... we want to avoid to scale down to this situation and probably stop at 0.75 where the image is still bigger than crop window and does not add the white edges...

Hopefully that clarifies my problem a bit better.

Screenshot 2024-07-24 at 4 42 47 PM Screenshot 2024-07-24 at 4 50 32 PM

Thanks again.

@rafaellichen
Copy link

rafaellichen commented Jul 26, 2024

if you are trying to scale down because the original image is too big to display, i think you should adjust/limit the dimension of the <img/> element, and keep scale as 1.

@nrvikas
Copy link
Author

nrvikas commented Jul 30, 2024

HI @rafaellichen - thanks, I will give it a try.

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

3 participants