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

Feature: refactor image scaling mode handling #122

Merged
merged 1 commit into from
Nov 30, 2023
Merged

Conversation

nopeless
Copy link
Contributor

Resolves #120

Let me know if you need some more features. I put WIP as I believe this needs more discussion

@Ruben2776
Copy link
Owner

Hi there, thanks for the PR.
I'm afraid I'm not sure what you're trying to accomplish. Setting BitmapScalingMode to NearestNeighbor results in images bigger than the screen resulotion to be visually downgraded.

@nopeless
Copy link
Contributor Author

nopeless commented Nov 9, 2023

Hi there, thanks for the PR. I'm afraid I'm not sure what you're trying to accomplish. Setting BitmapScalingMode to NearestNeighbor results in images bigger than the screen resulotion to be visually downgraded.

I also thought this might be a concern. personally it wasn't really noticeable, but I'll switch aliasing modes on zoom anyway. Thanks for pointing it out

I do a lot of pixel art work, and I need lightweight image viewers. Windows' default viewer doesn't have a configuration to change aliasing modes.

Before
image

After
image

@@ -471,12 +471,13 @@
x:Name="MainImageBorder"
HorizontalAlignment="Center"
VerticalAlignment="Center"
RenderOptions.BitmapScalingMode="Fant"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested the effect this has. Might remove it

@Ruben2776
Copy link
Owner

I have tried your changes myself, though I've only experienced the image looking worse using it.
However, it can be an option in the settings window.

If you want to edit your pull request to make the edits changeable by the user, I will accept it - or I can do the changes myself.

@nopeless
Copy link
Contributor Author

Sure, a setting would be good enough, where the user can toggle nearest neightbor, as long as its persistent. Anything I can do to help with this?

@Ruben2776
Copy link
Owner

Can you confirm if the commit b134215 is what you're referring to, and possibly edit or modify it with the PR if not?

@nopeless
Copy link
Contributor Author

I'll try to confirm it tomorrow

@nopeless
Copy link
Contributor Author

Judging from the code, it looks like the feature was implemented properly. I am excited to see this

@nopeless
Copy link
Contributor Author

@Ruben2776 I am getting crashes on the dev branch. I believe its just a simple mistake. Along with the fix, I also refactored it so that the logic is dealt in a more conventional manner and reduced duplicate code for future refactoring.

@nopeless
Copy link
Contributor Author

whoops, wrong file

@Ruben2776
Copy link
Owner

Thanks. Is there anything else to be added - or otherwise I will merge?

@nopeless nopeless changed the title [WIP] fix aliasing Feature: refactor image scaling mode handling Nov 30, 2023
@nopeless
Copy link
Contributor Author

@Ruben2776 It's good to go. Afaik, the application doesn't have invalid states but please check it and test it yourself as well just in case.

@Ruben2776 Ruben2776 merged commit cc8f0b4 into Ruben2776:dev Nov 30, 2023
1 check failed
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

Successfully merging this pull request may close these issues.

[Feature Request] Optional anti aliasing
2 participants