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

Improve image preview quality #895

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Conversation

darktorres
Copy link
Contributor

@darktorres darktorres commented Jan 9, 2023

@alexislefebvre
Copy link
Sponsor Contributor

alexislefebvre commented Jan 9, 2023

Bilinear doesn't appear on the link or when searching in the doc: https://docs.rs/image/latest/image/imageops/enum.FilterType.html?search=Bilinear

How does it work?

@darktorres
Copy link
Contributor Author

The manual for the change I made is in here:
https://docs.gtk.org/gdk-pixbuf/enum.InterpType.html
The first link is only for the images examples.

@darktorres
Copy link
Contributor Author

Gdk Bilinear is closest to imageops Triangle

@darktorres
Copy link
Contributor Author

I made a before/after in czkawka:

before_after

@qarmin
Copy link
Owner

qarmin commented Jan 17, 2023

What is time difference in loading big images?
The main reason why I choose such resizing algorithm is quite big loading/resizing times of files with >10 millions pixels.
If such times are too big, then only smallest files should be used to resized with this algorithm

@darktorres
Copy link
Contributor Author

There is a increase in time but I would say it's small considering the time spent loading the pixbuf.

Big image 124MP Nearest Bilinear
Load pixbuf 1389ms 1393ms
Resize pixbuf 23ms 199ms
Average image 1.3MP Nearest Bilinear
Load pixbuf 12ms 11ms
Resize pixbuf 0ms 9ms

@God-damnit-all
Copy link

It seems like it makes more sense to keep using nearest, the preview is just supposed to give you a rough idea of what you're working with, right?

@alexislefebvre
Copy link
Sponsor Contributor

alexislefebvre commented Jan 18, 2023

@ImportTaste With this PR, it should be easier to compare similar images since there will be less resizing artifacts in the previews of images.

@qarmin qarmin merged commit d39354a into qarmin:master Jan 18, 2023
@qarmin
Copy link
Owner

qarmin commented Jan 18, 2023

Thanks!

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.

4 participants