Skip to content

Add upscale smooth/pixelated option#531

Merged
RvanderLaan merged 3 commits into
allusion-app:masterfrom
AlanDrake:upscale-pixelated
Feb 4, 2023
Merged

Add upscale smooth/pixelated option#531
RvanderLaan merged 3 commits into
allusion-app:masterfrom
AlanDrake:upscale-pixelated

Conversation

@AlanDrake

@AlanDrake AlanDrake commented Nov 29, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

AlanDrake commented Feb 4, 2023

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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.

2 participants