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
Nothing is rendered at all for very small images at full size #46
Labels
bug
Something isn't working
Comments
I'm happy to take a crack at the second proposal I made above, but before I dive in, I'd like to know if you'd welcome it. :-) |
I think the general algorithm should be as follows:
The main problem with 2 might be that we might not know the best background color... perhaps just use the bottom right corner pixel color? Or just black or white? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given the attached files, I'd expect some sort of output, but tiv reports nothing.
5x5
4x4
3x3
2x2
1x1
I believe this applies to any image less than 8 pixel tall or 4 pixels wide. Ideally, something should be rendered for these tiny images.
I'm imaging two options:
My initial thought was to rescale the image so it's at least 4x8. This commit does exactly that. It's the only commit on the branch fix-tiny.
However, I'm now thinking of a different approach: If the image is smaller than target window in both directions, scale up to fill the space, but limit the scale to the the largest integer that won't cause the image to exceed the allotted space. Also use nearest neightbor interpolation. The result should provide larger "pixels". On the down side, this approach won't work for images that are very narrow but tall or very wide but short. That may yet require special case logic.
The text was updated successfully, but these errors were encountered: