Git Product home page Git Product logo

Comments (4)

Waitsnake avatar Waitsnake commented on June 16, 2024

Well what makes it "blurry" is the OpenGL filer for magnification that is set to GL_LINEAR at the moment. And for minifying it uses the OpenGL filer GL_LINEAR_MIPMAP_LINEAR that is similar.

For your special use case, to look at pixel art, it would help a lot to use different OpenGL filters, GL_NEAREST for magnification and GL_NEAREST_MIPMAP_NEAREST for minifying. Than the pictures and pixels are very sharp and not blurry at all.

But there are different users and different use cases for the screensaver. I know people that not using pixel art with it but maybe short video clips of nature. These look horrible with an GL_NEAREST or GL_NEAREST_MIPMAP_NEAREST filter. So maybe we need an extra option in the options dialog to let the user decide which filter is better.

But thing with another extra option is that the option dialog is already fraught with to many distracting options and is kind of hard to find a good place for it. I will think about it.

from animatedgif.

Waitsnake avatar Waitsnake commented on June 16, 2024

Next point to discuss is that "pixel perfect" rendering.
Or better, what is your own definition of "pixel perfect" rendering?

Is it enough to have just a sharp filter to enjoy the pixels?

Or do you mean with that, that only integer scale factors(1,2,3,4,5 ...) are allowed for magnification instead of fractional numbers (1.2, 1.738, 2.8372 ...)? E.g. an image can be shown at original size (1x), double size (2x -> 1 Pixel will be scaled to 4 pixels(2x2)), tripled size (3x -> 1 Pixel will be scaled to 9 pixels(3x3)) and so fourth.

This kind of magnification, that allows only integer scale factors, could lead in some cases to strange effects (depending on size of the image compared to the size of your screen) where you end up with unused borders around the picture in all directions. An example: you have an screen that is 1920x1080 pixel and your gif is 400x600. If you double the pixels by 2x it will be 800x1200 and not fit into the screen. So you can only use the 1x scale factor and end up with an 400x600 picture in the middle of the screen with 240 pixel border at the top and 240 pixel border at the bottom.

While an fractional number magnification of 1.8x would fit the screen perfect without an border at the top and at the bottom. It's very probably that for most users that enjoy pixel art they would hate the unused borders at left, right, top and bottom and an sharp GL_NEAREST filter that gives them the illusion of an "pixel perfect" image (because they see sharp pixels) and fills the screen as good as it is possible with an fractional number magnification is all they need.

Next question is how "pixel perfect" rendering works for minifying? Is this undefined for minifying since any minifying already is an fractional number smaller than 1.0 ? Or should we do the hassle and allow only special fractions for minifying, e.g. 1/2=0.5, 1/3=0.33333333, 1/4=0.25, 1/5=0.2 and so forth. Allowing only these fractions for minifying we could end up in the worst case with unused borders around the image as we have it for the "pixel perfect" magnification. But I doubt allowing only special fractions for minifying will better the picture in any way.

Well, if we say for minifying it makes no sense, but for magnification we allow only integer scale factors and go for it. In the end we still have to trust the results of OpenGL that do all the scaling work for us and that scaling works inside of OpenGL with float numbers (fraction numbers) all the time. So nobody will ever know if it is really "pixel perfect" rendering or not. And AnimatedGif needs to use OpenGL to benefit from the hardware acceleration of the graphic card.

I guess "pixel perfect" is just an overkill and a sharp filter is all we need.

from animatedgif.

Quenz avatar Quenz commented on June 16, 2024

Yes, perhaps "pixel perfect" wasn't the best term for me to use. I basically just meant sharp. I don't think there are a lot of pixel art backgrounds, especially gifs, that are larger than a typical screen, so I'm not really sure what the best way to deal with that edge case is.

But for magnification, no, I don't think it needs to be perfect, I, and I think most people would prefer it to fit the screen than every pixel to be actually pixel perfect. For most cases, I don't think it would make much difference.

from animatedgif.

Waitsnake avatar Waitsnake commented on June 16, 2024

Ok, I add with release 1.3.6 a new option to the preference panel to switch between the blur and the sharp image filter. I hope nobody cuts when he sees the sharp pixels. ;-)

from animatedgif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.