Giter Club home page Giter Club logo

Comments (8)

TylerRockwell avatar TylerRockwell commented on July 2, 2024

I've been doing some research into this, and I agree that it starts off with too small of a sample. This can easily be fixed by changing pixel-multiplier to a higher number. I think 3 or 5 is a good starting point.

This doesn't solve the whole issue, though. If you lein run pixelate the animation takes less than a minute to complete. However, when you lein run cycle, the animation may take longer.

There seems to be a correlation between how long pixelate takes to run and the animation that precedes it. The following examples were run with pixel-multiplier set to 5.

Preceding Animation Pixelate Time
Drag 1m 20s
Color Swap 30s
Tweet Reader 30s
Shifting Grid 4m 20s

Shifting Grid is clearly the biggest culprit here. I'm not sure what's causing the issue, but certain algorithms cause pixelate to run very slowly. The time between pixel changes seems to increase significantly.

Hopefully this can at least provide a starting point for solving this issue.

from fraqture.

Carrigan avatar Carrigan commented on July 2, 2024

Interesting! It doesn't look like we set the frame rate in pixelate- could you try running (q/frame-rate 30) in the setup function of shifting grid? It looks like those times correlate with the frame rates of those drawings.

from fraqture.

TylerRockwell avatar TylerRockwell commented on July 2, 2024

Confirmed. Changing q/frame-rate in shifting grid changes the speed pixelate runs at. By setting the frame rate in pixelate, it seems to run at a consistent speed now.

from fraqture.

sweetmandm avatar sweetmandm commented on July 2, 2024

I always thought it was because of varying resolutions of the input images, since the pixel size is set to a constant 10 here
https://github.com/smashingboxes/fraqture/blob/master/src/fraqture/pixelate.clj#L10-L11
and then looks like that value becomes a straight pixel coordinate here (modified by mult, but still not scaled by the image resolution)
https://github.com/smashingboxes/fraqture/blob/master/src/fraqture/pixelate.clj#L16-L17

Would it help if the starting pixel-width & height were proportional to the image resolution? pardon my procedural syntax, but something like
int size = max(image.width, image.height) / 40;
if you wanted to start with 40 of them along the longest edge.

from fraqture.

TylerRockwell avatar TylerRockwell commented on July 2, 2024

The resolution of the image doesn't seem to have an effect on the time of the animation. For example, the code.png image is 2548x1438 and the flower.jpg has a resolution of 713x500. Both take 36s to run through the whole animation.

I believe it may have to do with the way it divides the number of pixels remaining. It may start off the same every time, but I believe the number of pixels removed through each iteration is proportional to the image size.

from fraqture.

Carrigan avatar Carrigan commented on July 2, 2024

I believe the speed should only be dependent on the resolution of the screen, not the resolution of the image. Those lines that you linked scale based off of screen size, not image size.

from fraqture.

sweetmandm avatar sweetmandm commented on July 2, 2024

ah yeah I see it now, xs/ys are scaling it 👍

from fraqture.

Carrigan avatar Carrigan commented on July 2, 2024

Thanks for digging into this @TylerRockwell!

from fraqture.

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.