locked
Animated Gif/Animated PNG RRS feed

  • Question

  • Anyone know if Silverlight will support Animated Gif or even Animated PNG?

    Friday, January 25, 2008 9:33 AM

Answers

All replies

  • No these are not supported, gif isn't supported at all, you can get similar effects with a strip of images in a single image and changing the clip region to show a frame at a time.

    Friday, January 25, 2008 9:44 AM
  • I saw on the Silverlight Roadmap that GIF will be supported in Silverlight 2.0.  I'm wondering if that includes animated Gif because that will greatly simplify raster-based animations.

    I'll try out the PNG with clipping and test the performance.  A lot of what I want to try is games-based and having animated gifs and/or pngs would be a big plus and simplify what I am attempting to do.

     

    Friday, January 25, 2008 9:55 AM
  • It's too early to say Silverlight will or will not support GIF or animated PNG. Let's wait and see in Silverlight 2.0 Beta. My best guess is that both will be supported. GIF is natively supported across most platforms, and I think the its related patent issue will not affect the GIF support in Silverlight, because the GIF specs implementations are already there in those platforms.

    Friday, January 25, 2008 9:29 PM
  • I describe a way to effectively make a transparent, animated PNG here. Essentially the animation is done by having C# clip the image.

    http://timstall.dotnetdevelopersjournal.com/creating_a_transparent_animating_and_opaque_image_in_silve.htm

     

    Friday, January 25, 2008 10:22 PM
  • Hello Bill Reiss! HTML clipboard

    What an absurd solution on the part of an MVP :)

    There are a bazillions animated gifs out there, do the math first or qualify your answer as a kludge.

     

    M$ put the darn support for animated gifs, and stop this waste of forum posts.   We have real work and projects to achieve and we don't want some left wing codeComplex support for gif kind of solution .

    TIA.

    Saturday, January 16, 2010 3:50 AM
  • Well my opinion only.

    I think animated gif is thing of the past.  Just lazy people still want to use them today.  Blend X is your friend and make your own new stuff.  It's clearer, better, faster and more enjoyable then the old pixelated animated gif of the old school !

    MY OPINION ONLY.

     

    Saturday, January 16, 2010 7:04 AM
  • Hello Bill Reiss!

    What an absurd solution on the part of an MVP :)

    There are a bazillions animated gifs out there, do the math first or qualify your answer as a kludge.

    Please clarify your comment of "do the math first" and what is so absurd about my solution. Do you have a better workaround that doesn't include Microsoft providing support for animated GIF?

    Saturday, January 16, 2010 10:28 AM
  • M$ put the darn support for animated gifs, and stop this waste of forum posts.

    Since Bill is an MVP and presumably has to hold himself to a higher standard, I'll go ahead and give my response.

    Hey Marie123, FU. Grow up, get a life, and if you think you're being clever with the whole "M$" thing, I've got a bit of news for you. At this point, it's an idiot marker. Way to tag yourself.

    Saturday, January 16, 2010 7:25 PM
  • No, honestly if Marie123 has a better solution to the issue than what I suggested I'd love to hear it since it's what I'm currently using in my games and I'm open to other suggestions. Being an MVP doesn't mean you always have the right or the best answer and I am always open to new techniques.

    Now if the answer is "Microsoft should add support", then I could possibly agree but then why attack me for suggesting a workaround that actually works?

    Saturday, January 16, 2010 8:07 PM
  • Bill clearly answered the question. Animated .gif ARE NOT COMPATIBLE with Silverlight.
    Beside I wouldn't see the point of integrating an animated .gif in a Silverlight animation
    when Expression Blend allows you to do a much better animation job.
    The same logic applies to Flash. I mean really...
    Why integrate an animated gif. when you can use a much more performing inteface that offers plenty of more
    tools and options to deal with...
    Also "Animated. gif" are mainly "Frame by Frame" animation. Up to 2007 Adobe Photoshop CS2 version
    Adobe shipped a tool called ImageReady which had a specialized feature for creating "Animated. gif".
    Still the "Animated. gif" option were somehow pretty limited. Considering a frame rate of 24 fps...
    have you ever tried "morphing" 2 vector objects like you would do in Flash???
     It takes 2 seconds in Flash and an hour using frame by frame images in ImageReady!
    Also building fancy and elaborated animations from a series of drawings or images could easily turn out to
    be a long and tidious job. 

    I know cause back in the early Flash 3 days, I was asked to build a short 5 minutes animation segment
    with vector drawings using the same technic performed in the old Disney days. Yep... Frame by frame...
    Every animation motion had to be drawn by hand... 5 x (60x24) drawings... That was the mandate...
    Lazy job you say?...Patience and some damn good drawing skills
    would be more appropriate in that case...Though I wouldn't repeat the same tidious experience again today...

    As for your "do the math first or qualify your answer as a kludge" comment

    Bread by the nose kiddo... I believe you still have a lot more steps to climb... Grow up!!!
    Like Bill, which I do respect for his contribution in the SLV community by the way...
    some friends of mine earned a Silverlight MVP award. It's not something you find as
    a bonus gift in a Cracker Jack Box...
    MVP award represents skill, experience and knowledge...

    If you want to learn about the real animation stuff, I'll buy you a beer and tell you everything you want to know! :)

    Saturday, January 16, 2010 8:59 PM
  •  HTML clipboard

    Mr. Jack Bond, I think you're the one that needs to grow up.  Keep your fowl language in your games only! it has no place in this forum.  M$, in my case, is just a convenient short-hand nothing more.  Now, should I feel sorry it tipped you off?  Nah!

    Mr. MawashiKid, a word of wisdom from east-meet-west, I don't think I have much steps to climb but rather steps going down to the grave.  Thanks for the offer but I care neither for the beer nor for the frame-by-frame animation.  Now, if you have a supported solution for streaming FLVs, a user-control for SWF we can certainly meet and I'll even buy you dinner for a whole week.  When people ask in this forum about support for animated-gifs they may simply mean I want to incorporate this thing into my solution.  You are right it may not make sense to incorporate animated.gif into an SL animation but that's not what I am after, instead think incorporating animated.gif into my SL app.  So please! every SL evangelist out there, don't be too quick to jump and tell us how cool it is to do animation in Blend bla, may be one day I may get time to actually make use of it, today it is only a decent alternative to the brain-dead VS2008 xaml designer..  Ya ya, yah, I need to move to VS2010, actually I have no idea what's in it yet?

    May be I was hard on Bill but I don't think disrespectful, he happened to be in the viewfinder after a long long day/night's hunt for a quick simple elegant supported solution, after we are not asking for rocket science here.  I am still entitled thinking his solution is absurd for me particularly.

    So, first I apologize to Bill .  Keep in mind that after seeing this kind of answer on a sibling thread in the early morning and after spending yet another night trying to circumvent yet another SL side-thorn.  I wanted to get the point across that many SL gurus and Microsoft are missing the other side of the picture, if you want to gain market you don't throw in a !NO! a MAYBE is much better.  I happen to have exactly 2 animated GIFs in the whole collection (~100 SWFs 10% I authored, 52 GIFs not impacted by SL, 1412 JPGs and 680 PNGs).  and yes 2 animated-gifs is too many to consider Bill's suggestion for :).  I will not attempt re-exporting the GIF into separate images, reorganizing them into some stackpanel, wrapping it with an image and somehow making a dynamic clipping region (viewport) just in order to achieve some sequencing of some stills.  Waaaay too much pain, for me!   Also, how about people wanting to leverage all of those existing animated GIFs out there?  Which may have variable timing and certainly took some efforts putting them cleverly together.  Can you visualize the wasted effort of re-engineer  into SL something that already works for many?  Many of us are quite happy with such things, yes pixelization can be kinda of cute and we are willing to live with it.  Bill if you have a working source example, perhaps on your blog which I have not visited I may change my mind.  If you do please share a link otherwise I will assume only English words were spoken. Right now your "solution" is a good one perhaps for those wanting or having to re-engineer the working animations using SL new components.  Your solution "you can get similar effects with a strip of images in a single image and changing the clip region to show a frame at a time" without an actual working example is subject to many interprations, probably most incorrect. Again sorry Bill you just happen to be on my trail that night, I did see few turkeys but no animated-gif :-(

    Switching to the general audience..

    Now imagine some other folks (eg. Google, just kidding) were to make a technology "LiquidGold" that would allow people to:

    1. Code in .NET, (Heh you could throw in javascript, Python, C++ ... for others that care for it :)
    2. Play FLVs
    3. Play SWFs
    4. Play WMVs
    5. Play Animated GIF
    6. Render Unicode (language support)
    7. Intuitive relative URIs to my resources and simple access to cross domain resources.
    8. Provide an auto-panning ScrollViewer :)

    Do you really think for a moment I would hesitate to jump in the wagon? 

    My content was developed around few tools I developed with Flash AS2 (disclaimer: I am a poor developer at everything) basically one of them a flash-card like sequencer which has allowed me to sequence gif, jpeg, png, swf, mp3, Unicode into every slide.

    Flash has supported, as I needed it, SWF (nesting), FLV, Animated GIFs, JPG, PNG, MP3, etc... It enabled me (with quite some pain as well) to create my "mash-up" of  ideas and present them to the visitors.  I have successfully migrated 90% of the playback functionality using SL by overlaying page.aspx siblings with existing index.htm pages.  Doing this directly on top of the current folders structure, and reusing 100% of the exact same XML, MP3, JPG, PNG resources with those folders and shared-folders.  The other 10% of SWF, and animated gifs will have to be ported or spliced into SL layouts (I see some work-around suggestions out there via DIVs etc.. that's like Chinese to me :) until I dig into it.  Yes, yes streamable WMVs are cool too I will make use of them as well in time :)  If you wanna peek at my little world here it is:

    Why did I choose to move to SL?

    I decided to make a leap from Flash components to SL components partly because of Adobe's Flash retarded IDE, and the fact they don't bother converting your AS2 to AS3 (read no migration path equals continuous dumping on the poor programmers).  On the other hand, Microsoft does a decent job opening VB3,4,5,6 projects, likewise migrating C#/VB.NET projects from VS2003 to VS2005 to VS2008 and hopefully to VS2010.  That translates  into great leverage in my wikipedia.

    Leverage/Reuse is key..

    If SL/WPF is such a great technology why is it chocking at rendering a GIF file?  It not like it's gonna bog down those GPUs.   GIF/JPEG may be thought of the past, but they really should be something that sticks around like TXT  (ASCII) files imagine XML with a dozen file formats out there.   I believe in leverage and total reuse of most everything, in fact if you were around me and started talking too much I will simply slap you few times and insert you talking head in Silverlight today.  If you don't believe in reuse than you should not use any kind of object oriented anything, otherwise you're living a double standard :) like using Flash in your website while selling Silverlight.  If you feel inclined of always re-doing things with the latest hype that's fine but you should not try to shove it down everyone's throat.  The new ways of doing things in SL are great and fine for people doing things from slate zero.  I am not one of them.

    Microsoft has to think and design in from the ground up a smooth migration path.  Many folks are simply infatuated with Blend X Blend That, SL, .NET, Flash, Flex, AIR and more air, F#, ... I could careless, let me get from point A all the way to Z with the least of pain and torture and with the tools I am most familiar with. 

    Now why would I care about or even contemplate some open source project about "animated gif"  Personally, I think animated gif is a mundane thing belonging to the core of any web technology.  I have plenty headache with SL alone let alone synching some other parallel efforts.  Perhaps if the project was about some unique special use add-on to SL, and I have a terrible need for it, then yes, in that case, it would warrant my effort incorporating it into my solution.  A gif-animated /workaround project is doomed short-lived, and even if it won't be over-taken by a future release of SL, I am not going to hold my breath on it.

    Why should the community of developers suffer the cut-throat wars of titans, wouldn't it be better if everyone tried to work together instead of simply yelling use my format or nothing else.  What's so terribly challenging with SL to allow me to punch a hole right in the middle of its layout and let me present other kinds of formats :)  Yes I am willing to live with the performance degradation it could impose, and I promise I won't expect it to handle things if I decided to perform transforms/projections on the whole page, I simply won't in those solutions.

    My goal simply stated is to leverage whatever working formats are out there and present them under a snappy reactive/interactive interface, using the same tools both on the browser and server side (in my case that means C#/VB.NET and last ASP.NET only because I have too:).  Yesterday, it was HTML/Flash, today I am re-implementing my components in SL, tomorrow only God knows but you bet your underwears, I will move to whatever technology enables me to get my ideas across with the least of pain.  Adobe and Microsoft, in my eyes, have failed terribly in that regard.

    Marie.


    A simple challenge to Microsoft..., in the days of VB 1.0 and MSVC 1 context sensitive help somewhat worked.  Now 20 years later it does not even find something to display.  I have hard time believing all my countless installations of MSDN are flawed, like i forgot to insert the DVDs.   Thanks to Google one can find something out there in the big mess.    I whish I could wire F1 to some search engine and get my simple day-to-day needs met when I want to lookup something underneath the cursor.

    A word for Adobe if you wanna compete..., fire half of the artists and hire a good mix of programmers which have used a decent example of an IDE eg. VisualStudio, Eclipse, NetBean :)  While we are it tell those artists or enforce it that there is something called a "done" event when an animation completes. And if it is an endless animation, provide a simple test for it otherwise we have programming against undeterministic behaviors.

    Monday, January 18, 2010 5:38 AM
  • Here's a suggestion :)

    Based on what you said for FLASH at the end, I suggest you to take a little time to learn about coding which will let you make a single SL, yes I say Silverlight application that let you take a gif as input, extract each frame from it and with some easy properties you could set the FPS and then generate a xaml that once loaded, will look exactly like your gif.

    I tell you, there's nothing you can't do if you're whilling to learn a bit.
    You don't have time ? Then what ? wait for Microsoft to serve your needs ? The time you wrote your message, I'm sure you would have googled if you dislike Bing and found that in the BIG world of internet there's a solution already made for you or at least, a part of it.

    Here's something that could let you start hoping you will learn C# :)

    http://www.vcskicks.com/csharp_animated_gif.php

    I just want to be kind here.  Good luck !

    Monday, January 18, 2010 6:34 AM
  • Sure, here is a simple sample:

    http://www.bluerosegames.com/silverlight-games-101/post/Frame-Based-Sprite-Animation-in-Silverlight.aspx

    If you want to vary the times between animations you would need a list of times to wait between frames and grab the wait time for the current index. Additionally you could have a list of frame indexes if you wanted to access the frames in a non-linear order.

    As for the M$ garbage, you may want to avoid that on a Microsoft run board about Microsoft technologies, it won't make you many friends, and anyway how much is Microsoft charging to let you make Silverlight applications and deploy them commercially? That's right, it's completely free if you use Visual Web Developer Express. How much do Adobe's tools cost? And yes, I know there are free development environments for Flash but they are not provided by Adobe.

    Monday, January 18, 2010 7:40 AM
  • Oh and this might help too, to get the GIF into a PNG sprite sheet:

    http://www.bottomap.com/Software/A4B/A4B.html

    Monday, January 18, 2010 7:42 AM