animated-gif

python tkinter display animated GIF using PIL

旧城冷巷雨未停 提交于 2019-11-28 01:28:38
问题 Is there any way to display an animated GIF in Tkinter using Python Image Library? I thought the ImageSequence module would be the way to do it, but I don't know how to use it and if it's possible. The first question is if there is any easy way. For example: load a GIF using PIL and the ImageSequence and just draw it on a Tkinter window using ImageTk.PhotoImage and it will be animated. Or do I have to set up a function myself, using the after method or something like time.sleep to loop

Extracting single frames from an animated GIF to canvas

人走茶凉 提交于 2019-11-27 23:39:47
I need to load all the frames of an animated GIF to an HTML5 canvas. Please note, I don't want to "play" the animated (someone asked this before), all I want is to extract all the frames to use them as single images. Sorry, the short answer is that JavaScript has no way of controlling the current frame of an Animated GIF. The long answer is that there are sort-of ways to do what you want with just JS, but they are very much convoluted hacks. Example of hackish way: Create a canvas and don't add it to the DOM (so this won't be seen by anyone). In a fast loop (setTimeout), draw to this canvas

How to display animation in a JTable cell

岁酱吖の 提交于 2019-11-27 23:06:18
I am looking for a way to display an animated progress indicator (animated GIF, a rotating wheel rendered through Java2D etc., no preference here) in a table cell until the value that is to be finally displayed has been computed or retrieved. So far I have just put a static "pending..." text into each cell that is not yet ready to speed up display. As data arrives from a background thread I put it into the appropriate cell and call repaint on the table. With a static label or image this works fine, but because the cell rendering uses this only as sort of a rubber stamp and does not create

Proper way to reset a GIF animation with display:none on Chrome

淺唱寂寞╮ 提交于 2019-11-27 20:35:23
Title is self-explanatory, but I'll provide a step-by-step view on the matter. Hopefully I'm not the first one to have noticed this (apparently) bug on Webkit/Chrome. I want to reset a GIF animation. All of the examples I've seen so far either simply set the src of the image to itself or set it to an empty string followed by the original src again. Take a look at this JSFiddle for reference. The GIF resets perfectly fine on IE, Firefox and Chrome. The issue which I have is when the image has display:none on Google Chrome only . Check this JSFiddle . The GIF resets fine on IE and Firefox before

How to extract frames of an animated GIF with PHP

冷暖自知 提交于 2019-11-27 20:17:26
I search for a long time how to extract frames from an animated GIF with PHP... unfortunaly I just found how to get their duration... I really need to extract the GIF frames and their duration to apply some resize, rotate, etc, on each and then to regenerate the GIF with edited frames ! I don't want to use any software, external library (like ImageMagick), just PHP: in fact I need to allow my class http://phpimageworkshop.com/ to work with animated GIF. If you have any idea, I'm listening you ^^ ! Sybio I spent my day creating a class based on this one to achieve what I wanted using only PHP!

Animated GIF in HTML5 canvas

梦想的初衷 提交于 2019-11-27 17:49:50
In HTML5, how can I draw easily (no too much complex code please) an animated GIF in a canvas that works (with drawImage only first frame is shown in the canvas) rodrigob I believe you are looking for http://slbkbs.org/jsgif Unfortunately, the DOM doesn't expose individual frames of a GIF, so this is done by downloading the GIF (with XMLHttpRequest), parsing it, and drawing it on a <canvas> . Well if automated canvas animation of gif files isn't available, you could try using sprite-sheets, but that indeed would require a bit more code. var img_obj = { 'source': null, 'current': 0, 'total

How can I create animated gif in Java?

℡╲_俬逩灬. 提交于 2019-11-27 17:42:24
问题 I would like to create a gif image from the set of BufferedImages. How can I do this? Is there such library in pure Java (ImageMagick is not an option)? I've found Gif4J library but it's not royality-free. 回答1: I just answer a similar question here, but I think that my solution can help. 'ImageIcon' class allows you to load gif animations. I load the image with 'getResource()'. For doing this I normally us URL class to pass the file path. The path does not need to be necessary in a remote

Animated GIF on Fabric.js Canvas

扶醉桌前 提交于 2019-11-27 16:55:47
问题 I'm working on a project where I've been asked to support animated GIF on a fabric.js canvas. As per https://github.com/kangax/fabric.js/issues/560, I've followed the advice to render on regular intervals, using fabric.util.requestAnimFrame. Video renders just fine with this method, but GIFs don't seem to update. var canvas = new fabric.StaticCanvas(document.getElementById('stage')); fabric.util.requestAnimFrame(function render() { canvas.renderAll(); fabric.util.requestAnimFrame(render); });

How to resize an animated gif image using C#?

你。 提交于 2019-11-27 15:43:56
Is there a method to create a copy of an animated gif image using C#? What I want is to generate a copy of a given gif image using the height and width parameters that the user provides. I have tried for a couple of hours to accomplish this but the resulting image does not preserve the original animations. You need to loop through the frames in the animated GIF and resize each one. May also want to take a look at GifLib . Took me a while to find this, but finally found a solution: Install Magick.NET via NuGet, license can be found here: https://magick.codeplex.com/license Example code: var

How to load animated GIF from photo library

余生长醉 提交于 2019-11-27 14:13:02
问题 In iOS Swift I'm having difficulty loading an animated GIF from the device photo library to a UIImageView or creating a .gif file from it. I have no problem displaying the animated GIF if it's a file on a server or if it's right in the app. However, when I load it from the photo library, I lose the animation. I found some Objective-C solutions and tried to convert them over to Swift, but haven't had any luck. Here is what I have so far: @IBAction func buttonTapped(sender: UIButton) {