12 ms·
Introducing Lottie: Airbnb's tool for adding animations to native apps
- kunalslab 10y agoHow does this compare to Keyframes, which Facebook released back in November? https://code.facebook.com/posts/354469174916519/keyframes-delivering-scalable-high-quality-animations-to-mobile-clients/ https://code.facebook.com/posts/354469174916519/keyframes-de...
- dikaiosune 10y ago> There are libraries similar to Lottie, such as Marcus Eckert’s Squall and Facebook’s Keyframes, but our goals are slightly different. Facebook picked a small set of After Effects features to support, since they were focusing mainly on reactions, but we want to support as many as possible.
- kunalslab 10y agoInteresting. Supporting more AE features is a good plus. Can you talk more about the other goals that are different?
- deleted 10y ago[deleted]
- buba447 10y agoI can! I built out the iOS side of the project. Aside from supporting as many after effects features as possible we wanted push what could be done with animation. One example in the current version is using exported after effects files as animated transitions between view controllers. In the future we hope to support more programmatic and interactive uses of animations built in after effects.
- burntcookie90 10y agodifferent license as well (Apache vs BSD + Patent grant)
- buba447 10y agoThis supports a larger number of after effects animation features, it also has support for native animated view controller transitions, support for react native, programmatically masking arbitrary views from after effects layers. Check the readme on the github for each repo for more info :)
- buba447 10y agoAuthor of the iOS side of things here. Feel Free to ask any questions!
- hsavit1 10y agoWhich screens in the app are currently are using this?
- hsavit1 10y agoahh I see - I should have looked at the demo gifs!
- film42 10y agoOff topic, but why is the iOS app so big? It's currently 130MB, which is almost 3x larger than the Android app and 10x larger than what I'd expect. Are you guys planning on slimming the app down? Is that 130MB mostly libraries you depend on, or is it mostly fonts, images and other assets? Thanks!
- chris_7 10y agoYou can download the IPA itself and check (they're just zips). Spoiler alert is that the binary (unzipped) is 130mb, but I think this contains multiple architectures.
- buba447 10y agoActually this is perfectly ON-TOPIC :) Some of this come from a mixture of architectures, and the fact we are using Swift+Objc, or just large asset files. Its something we are actively working on fixing. One of the things we did to make it better was build Lottie! Now we can replace PNG sequences and Gifs that can be several megabytes with simple JSON animation files which measure in the low kilobytes. One such example is the diamond animation found on our listing pages. To include this in the project before Lottie we had to package a PNG sequence for each screen resolution(@1x @2x @3x) with alpha these sequences would add around 4-5 megabytes to our app for a single, small, animation. With Lottie we package a single JSON file which measures around 2 kilobytes!
- bennyg 10y agoAre animations in react-native offloaded to the native renderer, or are they in JS?
- buba447 10y agoFor Lottie, they are offloaded to native Core Animation. :)
- lrichardson 10y agoGreat question. Right now playing the animation with the imperative API in React Native will be driven entirely on the main thread, but the declarative API with `Animated` will not be (yet). I'm very interested in building the proper hooks natively to allow for usage with `useNativeDriver: true`. We are perfectly situated for this too, considering the author of the iOS side was also the engineer who introduced offloaded animations to React Native on the iOS side! (Source: I made the Lottie RN bindings, and work on RN at Airbnb)
- misiti3780 10y agoWhat are you building with RN at airbnb? What has been your experience? If you were starting a mobile company now, would you start with RN ?
- lrichardson 10y ago> What are you building with RN at airbnb? Various flows in the Airbnb app are built with React Native. Our recently launched "Experiences" platform is built mostly with React Native, and there are many flows in the app that are built with React Native. Overall it's probably about 10-20% of the app right now. The decision to use or not use React Native for a new feature is a function of what the team building the feature is familiar with, and whether or not we think we can deliver a good user experience with the technology or not. The answers to those questions are quickly evolving though as we build up more infrastructure around React Native, and as the familiarity with the platform grows. > What has been your experience? Generally positive, but the difficulty of integrating React Native into an existing mobile app with large existing native code bases should not be understated. It's not plug and play. I'm giving a talk about this in detail at React Conf in March. Make sure to check it out! > If you were starting a mobile company now, would you start with RN ? Yes. Keep in mind that I was the main proponent of React Native being experimented with and adopted at Airbnb. As a result, I have some bias and other people at Airbnb might have different feelings / experiences.
- gpeal 10y agoAuthor of the Android side of things here. Feel Free to ask any questions!
- spbaar 10y agoAre the frames drawn to a bitmap first or straight to a canvas? Can a single animation object display different parts of itself in different stages of that animation, or would a duplicate animation object be required?
- gpeal 10y agoIf there are no masks or mattes, the animation is drawn directly to the canvas and no bitmap allocations are necessary. If there is a matte, an 8 bit bitmap will be created and if there is a mask, a 32 bit bitmap will be created and drawn to. An animation can only be at one stage at a time but you can easily create multiple animations. If you want to have several copies of the same animation, there is a composition caching option that will prevent you from having to deserialize and parse the composition again.
- kumarm 10y agoThanks for the nifty tool and Making it so small to avoid bulking up APK's.
- kllrnohj 10y agoOne of the main reasons Android's VectorDrawable is only a small subset of SVG is to stick to only the subset of path drawing that performs reasonably well. How does Lottie deal with this? I know it calls to canvas directly when possible, but canvas.drawPath() is not exactly fast, either. What does the performance actually look like?
- gpeal 10y agoThe performance does definitely depend on the complexity of the animation. Small icons like the hamburger menu, wish list heart, hamburger arrow, etc run at 60fps. Even the main Lottie logo (http://airbnb.design/lottie/ http://airbnb.design/lottie/) that has pretty complex trim paths renders at ~60fps. Masks and mattes are the feature that incur the largest performance hit because they require allocating a bitmap (8 bit for mattes and 32 bit for masks), rendering to them, then drawing them back to the canvas.
- joshwcomeau 10y agoThis is awesome! Thanks for releasing this open-source.
- mxstbr 10y agoThis is huge. I did my first internship at a company that was half animators making huge TV ads you have seen, and half web devs/designers that made interactive (web) apps.[0] Lottie is, without a doubt, solving a huge problem in the industry. Previously, engineers were often stuck bolting animations and transients onto static PSDs, or designers fighting to communicate what they wanted an animation to be like. This completely get rids of the problem! I can't wait to try this out. Now I just need to learn After Effects... [0]: https://animade.tv https://animade.tv
- richforrester 10y ago> Now I just need to learn After Effects Kinda scares me that After Effects (video manipulation tool) will be used for web animation. Photoshop all over again? .ps: I'm in the same boat of having to learn AE. Or at least improve on my basic knowledge of it.
- buba447 10y agoAfter Effects isn't a video manipulation tool. Video manipulation is one of its capabilities, it is also capable of motion graphics and animating vector shapes. This library works off the vector shape side of after effects.
- richforrester 10y agoYes, it's been built towards motion graphics. Just as Photoshop has been geared towards web design over the years. It was originally a post processing tool. Hence the name. After Effects. Which is why this whole thing seems so similar to me.
- buba447 10y agoI see what ya mean! Its always felt like some weird mix of illustrator and photoshop to me. Strange to how PHOTOshop moved the graphic way and the lightroom became the defacto photo editor. Guess that's just software evolution for ya :)
- clay_to_n 10y agoAny plan for a web React version? Or are CSS + JS in a good enough state where a new tool isn't necessary?
- lee_a 10y agoThe file format/After Effects exporter used is from: https://github.com/bodymovin/bodymovin https://github.com/bodymovin/bodymovin which was pretty simple to use. I saw Lottie first, found bodymovin, and had an After Effects animation in our React app in about 15 minutes. edit: I'm not affiliated with either project.
- lrichardson 10y agoI plan on adding a React API for the bodymovin library in addition the react native library. They will likely have identical interfaces.
- srikz 10y agoReally cool! Will try it in a weekend project soon! :) This may give me a good incentive to learn using After Effects
- Mizza 10y agoThis is cool - I can actually see a small cottage industry forming around people who specialize in exactly this kind of animation.
- santaclaus 10y agoI'm sort of surprised that Adobe isn't building these sorts of features into CC and that large corps like Airbnb are having to roll their own! Seems like a big market to ignore.
- JusticeJuice 10y agoI wonder why they chose svg rendering over canvas for the react-native version.
- lrichardson 10y agoI'm not sure what you mean by this? The react-native version does nothing but wrap the ios/android libraries (which are CoreAnimation and Canvas based, respectively)
- pienight 10y agoDoes anyone know a decent guide to generating these kind of things in After Effects, rather than standard video effects?
- buba447 10y agoTheres plenty! Googling 'after effects shape animation' returned all of these: https://www.skillshare.com/classes/design/The-Ultimate-Guide-to-Shape-Layers-in-After-Effects/1814132356 https://www.skillshare.com/classes/design/The-Ultimate-Guide... https://helpx.adobe.com/after-effects/how-to/create-shape-vector-layers-animation.html https://helpx.adobe.com/after-effects/how-to/create-shape-ve... https://cgi.tutsplus.com/tutorials/how-to-create-a-fun-and-dynamic-animation-shapes-part--ae-25245 https://cgi.tutsplus.com/tutorials/how-to-create-a-fun-and-d... https://www.lynda.com/After-Effects-tutorials/Mograph-Techniques-Shape-Animation-After-Effects/155266-2.html https://www.lynda.com/After-Effects-tutorials/Mograph-Techni...
- pienight 10y agoShape animation is the term I was looking for! Thanks.
- foota 10y agoThis is really awesome, good work and congratulations to those that worked on this.
- timhj 10y agoEasier cross-device native animations puts a point in the 'app' column for the 'app v web-app' debate. nice one airbnb.
- lrichardson 10y agoStay tuned. It will work on the web as well :) (Note that you can do this _already_ with bodymovin on the web if you want to)
- e1g 10y agoHuge if true :D Thank you for porting this to the web. Right now we use a combination of react-motion, GSAP, D3 interpolation and other dark magic. A strong contender in this space is most welcome, especially if it's at a higher abstraction level.
- buskila 10y agoCan this be integrated into a Xamarin app? Is there anything similar for Xamarin?
- koolkao 10y agoImportant question for me as well. As a solo amateur developer I don't have time to keep up with the constant development of all the different platforms. I love the idea of this tool. This came just at the right time. I'm putting together a series of animations for patient education. In trying to make things cross-platform I had to resort to AE and non-interactive video. Lottie looks like it will enable me to string together something nicer, using native drawing functionality, and can incorporate more interactivity.
- therealsalih 10y agoin less than 48 hours Martijn van Dijk made this: https://github.com/martijn00/LottieXamarin https://github.com/martijn00/LottieXamarin Check it out!
- sorenjan 10y agoIs it possible to use any other programs than After Effects?
- therealsalih 10y agoNo, Lottie uses json files from an After Effects exetension called bodymovin. Maybe in the future someone will write an exporter for another program that can plugin!
- karlding 10y agoWas the name was inspired by Charlotte "Lotte" Reiniger [1], one of the pioneers of silhouette animation? If not, that's one happy coincidence! [1] https://en.wikipedia.org/wiki/Lotte_Reiniger https://en.wikipedia.org/wiki/Lotte_Reiniger
- lrichardson 10y agoIndeed it is! See https://github.com/airbnb/lottie-react-native#why-is-it-called-lottie https://github.com/airbnb/lottie-react-native#why-is-it-call...
- karlding 10y agoI read through the blog post and skimmed the project site, but it never occurred to me to check the README. Thanks!
- buba447 10y agoIt absolutely was! Theres s shout out to her and her amazing work on the github readme! Love her work! :)
- stuckagain 10y agoI was hoping it was named after the prolific murderess of Millhaven, in honor of what animations do to your battery life.
- hughes 10y agoReminds me heavily of mo.js[1], but for native apps. I was pretty impressed with how smooth the mo.js demos were. [1] https://news.ycombinator.com/item?id=13419665 https://news.ycombinator.com/item?id=13419665
- lobster_johnson 10y agoI associate AE with video production -- is it actually suitable for vector animation aimed at web/mobile?
- radley 10y agoAE's primary duty is motion graphics.
- intoverflow2 10y agoAE is a huge and extensive application, truly the lesser known gem of Adobe and what almost all non-3D animation is created with these days.
- coldcode 10y agoI wonder though whether users really want lots of fancy animations. Our apps have way too many that add absolutely nothing to the usability, and in fact take away from it as you have to wait until things are done sliding around the screen. It's not that some animation is a bad thing, but give people such easy ways to make everything move and dance and you wind up with a modern version of 1990's websites. Of course it's just a tool in the end, but knowing our design teams, we will get 5X more bouncy and 1/5 the usefulness.
- tekklloneer 10y agoI think every major action that results in a difference in presentation of information should have one, brief, direct animation. Any more, and it's horrifying.
- ozaark 10y agoIt's especially beneficial to the UX when attention is driven towards the user task. It's easier to digest short, helpful animation than reading through a block of text. No user wants a repeat of 90's animated gif obsession or the 00's overly dramatic Flash craze. Hopefully we don't regress because of more recent advanced animation capabilities.
- rimantas 10y agoTher is a place for animations in UI. First, if you have to wait animations can reduce the percepted waiting time, i.e. it is not so boring to stare at the screen when something is happening there. Also, animations can guide your attention accross the changes in the UI where without them suddent change in the data/interface shown would be disorientating. Of course it is all about finding the right balance.
- qq66 10y agoExtremely skillful and judicious use of animations can make an UI 50% better, and hamfisted use of animations can make a UI 90% worse.
- qq66 10y agoExtremely skillful and judicious use of animations can make an UI 50% better, and hamfisted use of animations can make a UI 90% worse.
- Keyframe 10y agoThis is exciting! "Facebook picked a small set of After Effects features to support, since they were focusing mainly on reactions, but we want to support as many as possible." Does that mean expressions as well? wiggle, wiggle!
- buba447 10y agoNo expressions yet! But we're kicking the idea around!
- LeicaLatte 10y agoLooks interesting. My current workflow is similar and uses Apple Motion to produce animations for iOS.
- Kiro 10y agoIf you need After Effects anyway, why not just export a GIF or something? What's the benefit of rendering it in real-time?
- enra 10y agoGifs work, but if you want to make them high frame rate and high resolution, they can get quite large in filesize, especially if you want to support transparency (and still it wont support alpha transparency). Just on an iOS app, you would have to export the animation gif in 1x, 2x, 3x resolutions. Lottie uses json file that contains svgs and the animation, which can be compressed quite well, always display in the right resolution and whatever size you desire.
- nthState 10y agoI wonder how this will affect Marcus Eckert’s Squall. Squall, a paid plug-in vs a free library. I find it annoying when things like this happens, an independent developer works on something for ages and tries to make some money, then a large company releases something pretty much the same for free. Note: I'm not taking anything away from either product, both are super amazing. gah/ just my $0.02
- skynode 10y agoI'm currently facing the same dilemma as an indie developer working on a data analysis/data visualization product. Companies like Tableau and co can afford to squeeze the juice of indie developers by offering similar featured products for free. I try not to get discouraged though. I think the field is really large and there are quite a ton of ways to make inroads these days but I think it's also important to play in large enough markets, so better to play in the $120bn+ data analytics market than some $100m market with one well-nourished, fast moving white shark.
- therealsalih 10y agoYea I see what you're saying. We built on top of bodymovin which was an already open source. Hernan put a ton of work into it that we were able to stand on top of. We wouldn't have even started Lottie without his project. Personally I think theres plenty of room for all three, Lottie, Squall and Keyframes. We still use Squall here at Airbnb because Squall has some things to offer that Lottie doesn't. The After Effects preview app is really dope, and we'll never make one of those. We may not use it in our codebase, but to anyone wanting to seriously use Lottie I would recommend buying Squall so you can preview on your device so easy.
- intoverflow2 10y agoPretty much remade what the original value proposition of Flash was before it became more of a dev environment.
- samlittlewood 10y agoI'm curious how easy it would be to export content from Synfig (an open source 2d vector animation tool) http://www.synfig.org http://www.synfig.org - that would then be open source end to end.