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

Add upscale smooth/pixelated option #531

Merged
merged 3 commits into from Feb 4, 2023

Conversation

AlanDrake
Copy link
Contributor

@AlanDrake AlanDrake commented Nov 29, 2022

Implements an option to choose whether to use 'pixelated' image-rendering or the default when displaying upscaled images.
Can be useful for displaying pixelart or other small pics that might look better without the blur.

Gotchas:

  • 'pixelated' can cause a wiggling behavior when zoomed this is due to two factors apparently fixed in current electron
    • rogue repaints from animated previews in the gallery (perhaps they should be hidden while slide is open?)
    • transform3d not handling half-borders correctly upscaling with 'pixelated' (maybe changing width/height directly could be an alternative)
  • since I'm not advanced in react, I'm not sure how to make the slide update the the UpscaleMode setting realtime fixed by RvanderLaan

@RvanderLaan
Copy link
Collaborator

This is a nice addition, thanks!

  • I didn't experience any wiggling, it's silky smooth for me still
  • Not sure whether the hardcoded 320px restriction in the GalleryItem is what's always desired, but I'm not sure what would be better. It's okay for now though. But maybe you have any other ideas?

I made it work in real time (related to our state management using MobX, components using stores need to be explicitly observed), and also added it as a context menu option:

allusion-upscale-filter.mp4

These are the changes:
upscale-filter.patch

@AlanDrake
Copy link
Contributor Author

AlanDrake commented Feb 4, 2023

I didn't experience any wiggling, it's silky smooth for me still

You're right, looks like the rendering bug has been fixed in electron.

Not sure whether the hardcoded 320px restriction in the GalleryItem is what's always desired, but I'm not sure what would be better. It's okay for now though. But maybe you have any other ideas?

That's a general use approximation. Ideally you'd want to use the pixelated upscale filter only when you're magnifying something by >= 2, so it would depend on the container size and thumbnail size.

@RvanderLaan
Copy link
Collaborator

Thanks for the quick response! And sorry this has been catching dust for a while, it's much appreciated 😃

I'm gonna get it released this weekend 👍

@RvanderLaan RvanderLaan merged commit 813384a into allusion-app:master Feb 4, 2023
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.

None yet

2 participants