Pixelation

General => General Discussion => Topic started by: 1ucas on April 10, 2010, 10:03:55 pm

Title: Introducing a new tool: JavaScript-based GIF animation player
Post by: 1ucas on April 10, 2010, 10:03:55 pm
One of the problems with animated GIFs is that we can't just stop them in the browser and play them frame by frame. It is very cumbersome when someone posts an animation and we have to save it and open it locally in order to analyze it.

Well, I created this little tool to help us with that. It's entirely based on JavaScript and some server-side processing of GIF files. The whole thing is cached, too, so it should be really fast once the first person processes a GIF file. The usage in a page is completely unobtrusive and simple and will work with any GIF file in any server, as long as it is below 1 MB in size.

Here's a test page. (http://toxicdump.org/labs/frameviewer/)

Now, I'm not sure if the admins here would like to implement this, Indigo has shown some interest, but I think it would be very neat and useful for us. I'll also try to integrate it with the zoom feature soon, and I'm working on a few extra ideas (hotlinking to specific frames, etc.)

Either way, it should be possible to use it as a GreaseMonkey/UserJS script to whoever is interested.

Also, notice there are still some minor bugs in processing the frames (Fool's dog disappears for a few frames, I'm still trying to figure that out).

Suggestions are welcomed!

(Whoops! I posted this under "pixel art" instead of "general discussion". :-[ Someone please move it.)
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: fil_razorback on April 11, 2010, 12:15:32 am
It works great and will certainly prove useful. Thanks for crafting this =)
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: Dusty on April 11, 2010, 12:40:44 am
Way better than opening a GIF up in imageready. However, do you plan on adding it so we can load individual images from a url?
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: Ai on April 11, 2010, 12:58:35 am
Wow, this is awesome. So useful :D
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: 1ucas on April 11, 2010, 01:12:56 am
Way better than opening a GIF up in imageready. However, do you plan on adding it so we can load individual images from a url?

Sure. Here you go. (http://toxicdump.org/labs/frameviewer/viewer.php)
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: Mike on April 11, 2010, 03:16:14 am
I really hope this gets implemented!
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: Mathias on April 11, 2010, 04:50:10 am
This is brilliant! I also am hoping for an implementation here. VERY useful feature. How will it bode with the zoom feature, though?

What shall we call it? It needs an official name. You can then slap a lil' logo on the URL loader page you just linked. Something like FreezeFrame or FrameViewer, or GIFstasis. . .

Some thoughts/suggestions:

1) Make the UI a little smaller - the bar that pops up with you click the "view frames" link.

2) Add a typical prog bar behind the "processing" and "loading" text so progress can be measured.

3) Only freeze the animation when the cursor is rolled over the GIF. Let it play even in frame viewing mode.
I dunno about everyone else, but I found myself alternating between inspecting frames and wanting to see it animate - had to hit the X button and then the "view frames" link to go back and forth.

4) I'd like to submit a re-skin of your frame viewing mode UI.


I don't want to bloat your project. These are just some thoughts I had, trying your tool out. Great job!
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: 1ucas on April 11, 2010, 02:02:02 pm
This is brilliant! I also am hoping for an implementation here. VERY useful feature. How will it bode with the zoom feature, though
I'm already in the process of making it play along with the zoom feature.

What shall we call it? It needs an official name. You can then slap a lil' logo on the URL loader page you just linked. Something like FreezeFrame or FrameViewer, or GIFstasis. . .
*shrugs*
I call it FrameViewer. You guys can feel free to come up with a name or a logo, and I'll happily use it.

1) Make the UI a little smaller - the bar that pops up with you click the "view frames" link.
I will reduce it from 20 px to 15 px in height, and let all the parameters be configurable if anyone wants to.

2) Add a typical prog bar behind the "processing" and "loading" text so progress can be measured.
I'm using pure JavaScript with asynchronous requests to other server. There's no way to keep track of progress during processing, and even during the actual loading of the image. All I can do is add a little animation, which is meaningless.

I was planning on a Flash version which would allow a lot of extra fancy stuff, but I'm not sure if it would be as well received as a pure JavaScript version. It's up to you guys.

3) Only freeze the animation when the cursor is rolled over the GIF. Let it play even in frame viewing mode.
I dunno about everyone else, but I found myself alternating between inspecting frames and wanting to see it animate - had to hit the X button and then the "view frames" link to go back and forth.
The idea here was to let you pause two animations of the same walking cycle, for example, and compare their frames one by one. If I only paused with the mouse over the image you wouldn't be able to do that. I could add a unpause button to the FrameViewer interface that would play it without closing the tool bar, though.

But please, note that I can't make it play exactly from that paused frame, unless I did the entire timing thing on JavaScript as well. It is possible, but would be a pain in the ass and would slow down animations if the delays are too short. JavaScript timers are too unreliable.

4) I'd like to submit a re-skin of your frame viewing mode UI.
Please do! The idea is to have it very customizable. I might add a little config dialog (saved with cookies) to let users fiddle around with the settings later on.

I don't want to bloat your project. These are just some thoughts I had, trying your tool out. Great job!
Thanks man. If you come up with any more ideas, let me know.
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: 1ucas on April 15, 2010, 11:55:36 am
NEW UPDATE!

Good news, everyone! I've worked some more on the tool and I think it's just about ready for us to use here (if the admins are up to it, that is). Here's a changelog:


Also, I've created some quick aids for the viewer (http://toxicdump.org/labs/frameviewer/viewer.php):



Well, that's it for now! Got a few more ideas to implement, but this is good enough to go!

Again, don't refrain from posting any comments, bugs and suggestions. Cheers!
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: Gil on April 15, 2010, 03:52:36 pm
Okay, two suggestions.

First suggestion:

A page that shows only the images that are zoomable and are not avatars (this will require the avatars to have an extra CSS class "avatar" I suppose). That way we don't have to look at the banner, buttons, etc.

Second suggestion:
Being able to do this:

[img frame=4]http://url here[/img]

It should show only the selected frame
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: 1ucas on April 15, 2010, 04:09:04 pm
A page that shows only the images that are zoomable and are not avatars (this will require the avatars to have an extra CSS class "avatar" I suppose). That way we don't have to look at the banner, buttons, etc.
I did that initially, but the viewer by URL was supposed to be a more general tool, not really exclusive to this site's HTML code. But hey, I can just add a conditional for this domain, that would make sense. This modification is already up, by the way. :)

Being able to do this: [img frame=4]http://url here[/img]
That'd require fiddling with the forum code, which I have no access to. I'm already working on a JavaScript based hotlinking feature that'll work for these purposes, but it can't work unless the script is already embedded in the forum HTML.
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: ptoing on April 15, 2010, 09:30:02 pm
Cool stuff.

Adam and I will see that we can implement this with the next forum update.  :y:
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: crab2selout.png on April 16, 2010, 05:39:02 am
Would it be possible to make this as a firefox addon?

It'd be awesome to have this available here, but would be even better if you could use this on any website.
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: 1ucas on April 16, 2010, 07:07:16 am
Would it be possible to make this as a firefox addon?  It'd be awesome to have this available here, but would be even better if you could use this on any website.
Well, a GIF extension would be much better, but would be specific to Firefox. What you can do is grab the first bookmarklet at the bottom of this page (http://toxicdump.org/labs/frameviewer/viewer.php/).

It will embed FrameViewer on ANY site, and it'll work through ALL GIF files. This can be really annoying sometimes, because each little GIF icon will end up having the toolbar. This is also rather buggy as it is, because a lot of special positioning in GIF files are not properly handled yet (still working on an universal method for it). In fact, some images will just disappear for some reason. The tool was made for plain inline images, so it works best with those.

The second bookmarklet there will open all GIF files in the viewer page, which will avoid all these problems. I also followed Gil's suggestion, so if you're coming from this site, it'll only grab the zoomable images.
Title: Re: Introducing a new tool: JavaScript-based GIF animation player
Post by: 1ucas on April 30, 2010, 01:53:21 am
Hey, just want to point out that I just fixed a major issue that made that little form for specific GIF URLs completely useless.  :'( Not sure for how long this problem has been around...
(a big thanks to Hatch over PJ for warning me about it.)

Sorry if anyone has been troubled by it. Things should work as expected now.  :crazy: