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

Enhance enlarge by resynthesis #126

Open
bootchk opened this issue Sep 22, 2023 · 0 comments
Open

Enhance enlarge by resynthesis #126

bootchk opened this issue Sep 22, 2023 · 0 comments

Comments

@bootchk
Copy link
Owner

bootchk commented Sep 22, 2023

Just an idea.

For people who like to write plugins and experiment with image algorithms.

Currently, the "Enlarge by resynthesis" plugin works like this: it enlarges the image conventionally (which interpolates using a conventional kernel filter.)
That kernel might give new color values to all pixels in the image, even the originals.
(You should check that assertion, my conception could be wrong.)
Then it resynthesizes the whole image, from itself.

A better algorithm might be to add rows and columns to the image, between each pair of pixels.
Then select those new empty rows and columns, and synthesize those.
Thus the algorithm retains the original color values for the original pixels, which the previous algorithm does not.
The new pixels are synthesized by patch matching, which might plausibly give a better result.
The new pixels would have color values that were originally in the image
(it would not interpolate color values.)
The result image might still look grainy (since no interpolation was done.)
Again, the color map (set of distinct colors) is not changed.

Simpler to think about when scaling factor is two.
More complicated for other fractional and integral scaling factors.

I don't think this is very important.
Simple scaling seems to work as well as enlarging with resynthesis.
The new algorithm also probably won't work any better than simple scaling,
at least as far as most viewers perceive.

One reason I can think of doing this is for indexed images (using a color map.)
But the resynthesizer doesn't accept indexed images.
That might be a separate issue, there is no reason it shouldn't.
I

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