4 – An update on outputting results in Ansys Mechanical: Animated GIFs

Categories:

This post is the fourth of six, and it is about making animation files that are not videos, called Animated GIFs (pronounced with a J like Jeff, not G like Garry).
For a couple of reasons, making an animated gif is not as easy as we would like, but with a few tips below, it is not so difficult.

Animated GIFs explained

The GIF image file, Graphics Interchange Format, was invented in 1987 when color computing was new and the internet was not around yet. It is compact and allows only 256 colors (remember that part) and supported animation. The animated format was very popular on dial-up services and the early internet. They then fell out of favor until their use in messaging apps and social media to send animations to people that did not require a player. Everyone could see your cat falling off the table, instantly.

Or their dog being woken up in the middle of an afternoon nap. I just took my iPhone, turned around in my chair, and took this video. Then I converted it to a GIF. It took me less than 30 seconds to make and share this gem:

Maggie Wake Up

For those of us in the world of simulation, they have been a popular format for the same reason—almost all applications, from email to web browsers to Microsoft Powerpoint, support animated GIFs. The file contains as many images as you want and a tag for each layer documenting how long to display each frame. The difference is we are not capturing our overweight mutt struggling to roll over. We have specific information we are trying to convey.

Ansys Mechanical Default

If you read the post about making videos, you will remember that one of the output options was GIF. Well, here is what you get when you use that option. Note, it only plays once, to play it again.

i1 m15 1

And by default, the file does not repeat. Also, to make things worse, the way Ansys stores the GIF is an order of magnitude larger than a video.

As a contrast, here is the same result as a video played through YouTube:

Impeller vibration using a video file rather than GIF. As shown with YouTube

Video to GIF is much better

So, unless you need something in 30 seconds, don’t use the default save video as GIF in Ansys Mechanical. A much better option is to convert a good video to a GIF.

So, go back to the article on making videos and get what you want for your animation using that info and save it to *.mp4 format. Then use one of the methods below to convert that to GIF.

Ezgif.com

If I take the video above that I posted on YouTube and run it through the free conversion tool, ezgif.com, I get this:

i1 m15 1 ezgif

It is not as nice as the video, but it does not need a player. It just plays. Ezgif.com is free (lots of advertising) but has a lot of options. Not only does it covert quickly, but it also lets you crop, resize, add effects, change the speed, add text, and overlay.

The downside, if you have proprietary information you are letting someone else see it. My guess is uploading to a free server in the cloud will violate any NDA or security you have in place. But if not, ezgif.com is the simplest way to get a GIF from a video.

Adobe PhotoShop

The first option, if you can’t use a free cloud-based tool like ezgif.com, is the Photoshop suite. Photoshop is the defacto tool for image editing and processing, and it has a lot of tools for making sophisticated animated GIFs, including importing a video, editing the frames from the video, and outputting a GIF.

Here is the process:

  1. Open Adobe Photoshop
  2. Chose File > Import > Vidio to Layers
  3. Chose your MP4 file
  4. In the “Import Video to Layers” dialog, make sure “From Beginning to End” is chosen and “Make Frame Animation” is checked on.
  5. Click OK
    1. At this point, you can do a huge amount of modifying and editing. But that is way beyond the scope of this post. We just want a GIF made. But if you know Adobe Photoshop, have at it. I often crop and change the size here. Maybe even run some filters on it. Or, if I’m getting really fancy, delete the background from each frame to have a transparent animation.
  6. Go to File > Export > Save for Web (Legacy)
  7. Chose GIF as the file format.
    1. Set colors to 256
    2. I like to set Dither to 100%
    3. Make sure Animation > Looping Options at the bottom is set to Forever.
    4. Click Save… and give it a file name.
image 87

Here is what the result looks like:

i1 m15 1 PS1 1

Adobe Premier

Adobe Premiere is, well, the premier tool for video editing and creation. Many professional videos are made with this tool. It is massive, powerful, and made for people who speak video. If you want to add to your animation, do fancy things with it, use Premiere. Otherwise, stick with Photoshop or an open-source or cloud tool.

But, if you want to use Premier, here is that basic process without any bells or whistles (literally and figuratively) added in:

  1. Open a new Project
  2. Specify a good directory for the project
  3. Drop your MP4into the Project Window
  4. The drag it to the Timeline
    1. Here is where you do your editing magic on the video.
  5. When you are ready to make your file, click File > Export > Media
  6. Chose Animated GIF for the format
    1. Do not pick GIF. That will make an image of every frame.
  7. Click on the name next to “Output Name” to set the name and directory.
  8. Make any other changes you feel are correct if you know Premier.
  9. Click Export
image 88

This is what you get.

i1 m15 1 Premier 1 1

GifTuna

if you don’t have access to any Adobe tools, I recommend GifTuna. Yes, the name is stupid. But it works and it is free.

Go to giftuna.io and download the app. it comes as a ZIP file. Just extract the zip file and run the executable, GifTuna.exe. It will then ask you to install FFMPEG. This is the same library that ezgif.com uses.

Once everything is installed:

  1. Click “Select File”
  2. Select the video you saved in Ansys Mechanical.
  3. Change the size if you want to
  4. Keep all the other defaults for your first pass.
  5. Click Export
image 85
image 86

You get a pretty nice video. Play with the dither options if it looks kind of fuzzy.

i1 m15 1 giftuna

Making an Animated GIF out of Images

In all the examples above, we created animations by converting a good video into an animated GIF format. What if we just have a bunch of images and want to make a slide show out of them. Or maybe we want to show a series of geometry changes. Maybe the various steps in an animation.

In that case, save an image to a PNG or JPEG file for each frame you want, then use ezgif.com or PhotoShop to make your animation.

A word about APNG

The only real problem with Animated GIFS is that the GIF format only supports 256 colors. In many ways, PNG took over for GIF as the preferred file format. It is compact, handles transparency, and has the advantage of not being restricted on colors. The problem, only browsers support APNG. PowerPoint and most mail programs do not. And many tools like the Adobe Suite do not output in that format. But, ezgif.com does.

In fact, WordPress does not support the format. To view the APNG file, download this file and then open it in a browser:

Maybe someday this will be supported better. Hopefully in Microsoft products soon.

Moving from Motion to 3D

This should help you get a nice animation that you can put on a website and not have to worry about hosting so people can see it. The same goes for Email and PowerPoint. If you can live with fewer colors, it really is the best format for animations of results when you need to show them anywhere.

Now it’s time to move from 2D results to 3D. We will cover how to create 3D objects of your results in “5 – An update on outputting results in Ansys Mechanical: 3D Result Objects.

Categories

Get Your Ansys Products & Support from the Engineers who Contribute to this Blog.

Technical Expertise to Enable your Addictive Manufacturing Success.

PADT Pulse Newsletter Screen Grab from March 2023

PADT’s Pulse Newsletter

Keep up to date on what is going on at PADT by subscribing to our newsletter.


By submitting this form, you are consenting to receive marketing emails from: . You can revoke your consent to receive emails at any time by using the SafeUnsubscribe® link, found at the bottom of every email. Emails are serviced by Constant Contact

Share this post:

Upcoming Events

05/24/2023

Hill Air Force Base Tech Expo

05/24/2023

Structural Updates in Ansys 2023 R1 (3) – Structural Optimization & Ex

05/23/2023

CROSSTALK 2023: Emerging Opportunities for Advanced Manufacturing Smal

05/10/2023

Signal & Power Integrity Updates in Ansys 2023 R1 - Webinar

04/26/2023

Additive Manufacturing Updates in Ansys 2023 R1 - Webinar

04/20/2023

38th Space Symposium Arizona Space Industry

More Info

04/19/2023

38th Space Symposium
Arizona Space Industry

04/19/2023

Additive Aids for Manufacturing - Webinar

04/18/2023

38th Space Symposium
Arizona Space Industry

04/17/2023

38th Space Symposium

04/13/2023

Venture Madness 2023

04/12/2023

Fluid Meshing & GPU-Solver Updates in Ansys 2023 R1 - Webinar

03/29/2023

8th Thermal and Fluids Engineering Conference

03/29/2023

Structural Updates in Ansys 2023 R1 - Composites, Fracture & MAPDL

03/28/2023

8th Thermal and Fluids Engineering Conference

03/27/2023

8th Thermal and Fluids Engineering Conference

03/26/2023

8TH Thermal and Fluids Engineering Conference

03/24/2023

Arizona BioPreneur Conference | Spring 2023

03/22/2023

2023 Arizona MedTech Conference

03/22/2023

Optimize Jigs & Fixtures with Additive - Webinar

03/15/2023

3D Design Updates in Ansys 2023 R1 - Webinar

03/08/2023

Competitive Advantages of 1D/3D Coupled Simulation - Webinar

03/01/2023

High Frequency Updates in Ansys 2023 R1 - Webinar

02/22/2023

Additive Advantages in Aerospace - Webinar

02/15/2023

Structural Updates in Ansys 2023 R1 (1) - Webinar

02/09/2023

IME 2023: MD&M | WestPack | ATX | D&M | Plastek

02/08/2023

IME 2023 MD&M | WestPack | ATX | D&M | Plastek

02/07/2023

IME 2023 MD&M | WestPack | ATX | D&M | Plastek

01/27/2023

Arizona Photonics Days, 2023

01/26/2023

Arizona Photonics Days, 2023

01/26/2023

TIPE 3D Printing | 2023

01/26/2023

Venture Cafe Phoenix Talent Night - Job Fari

01/26/2023

VFS 2023 Autonomous/Electric VTOL Symposium

01/25/2023

Arizona Photonics Days, 2023

01/25/2023

Building A.M.- Utah: Kickoff!

01/25/2023

TIPE 3D Printing | 2023

01/25/2023

VFS 2023 Autonomous/Electric VTOL Symposium

01/24/2023

VFS 2023 Autonomous/Electric VTOL Symposium

01/24/2023

TIPE 3D Printing | 2023

01/18/2023

2023 AZ Tech Council Golf Tournament

12/21/2022

Simulation Best Practices for 5G Technology - Webinar

12/14/2022

Digital Twins Updates in Ansys 2022 R2 - Webinar

12/08/2022

Tech the Halls - AZ Tech Council Holiday Mixer

12/07/2022

Electric Vehicle and Other Infrastructure Update Panel

11/30/2022

SPEOS Updates in Ansys 2022 R2 - Webinar

11/23/2022

Simulation Best Practices for Electronics Reliability - Webinar

11/16/2022

Discovery Updates in Ansys 2022 R2

11/10/2022

VentureCafe Phoenix Panel: Venture Capital in AZ

11/08/2022

2022 GOVERNOR’S CELEBRATION OF INNOVATION AWARDS + TECH SHOWCASE

11/03/2022

VentureCafe Phoenix Panel: Angel Investment in AZ

11/02/2022

High & Low Frequency Electromagnetics Updates in Ansys 2022 R2

10/26/2022

Simulation Best Practices For Chip-Package-System Design & Development

10/20/2022

Nerdtoberfest 2022

10/19/2022

2022 Southern Arizona Tech + Business Expo

10/19/2022

LS-DYNA Updates in Ansys 2022 R2 - Webinar

10/17/2022

Experience Stratasys Truck Tour - Clearfield Utah

10/14/2022

ASU School of Manufacturing Systems and Networks - Formal Opening Cele

10/14/2022

Experience Stratasys Truck Tour - Midvale Utah

10/12/2022

Experience Stratasys Truck Tour - Littleton Colorado

10/06/2022

Fluids Updates in Ansys 2022 R2 - Webinar

10/05/2022

Experience Stratasys Truck Tour - Colorado Springs

09/29/2022

White Hat Life Science Investor Conference - 2022

09/28/2022

2022 AZBio Awards

09/28/2022

Simulation Best Practices for Rotating Machinery Design & Development

09/21/2022

ExperienceIT NM 2022

09/21/2022

Additive Updates in Ansys 2022 R2 - Webinar

09/14/2022

Rocky Mountain Life Sciences Investor & Partnering Conference

09/08/2022

Ansys Optics Simulation User Group Meeting - Virtual

09/08/2022

Ansys Optics Simulation User Group Meeting

09/07/2022

SI & PI Updates in Ansys 2022 R2 - Webinar

08/31/2022

Simulation Best Practices for Developing Medical Devices - Webinar

08/24/2022

Mechanical Updates in Ansys 2022 R2 - Webinar

08/10/2022

Tucson after5 Tech Mixer: Ruda-Cardinal

08/05/2022

Flagstaff Tech Tour, 2022

08/02/2022

2022 CEO Leadership Retreat

08/01/2022

2022 CEO Leadership Retreat

07/27/2022

Thermal Integrity Updates in Ansys 2022 R1 - Webinar

07/20/2022

Simulation Best Practices for the Pharmaceutical Industry - Webinar

07/14/2022

NCMS Technology Showcase: Corpus Christi Army Depot

07/13/2022

NCMS Technology Showcase: Corpus Christi Army Depot

07/13/2022

Additive & Structural Optimization Updates in Ansys 2022 R1 - Webinar

07/07/2022

Arizona AADM Conference, 2022

06/29/2022

LS-DYNA Updates & Advancements in Ansys 2022 R1 - Webinar

06/23/2022

Simulation Best Practices for Wind Turbine Design - Webinar

06/15/2022

MAPDL Updates & Advancements in Ansys 2022 R1 - Webinar

06/01/2022

Mechanical Updates in Ansys 2022 R1 - pt. 2 Webinar

05/26/2022

Modelling liquid cryogenic rocket engines in Flownex - Webinar

05/25/2022

SMR & Advanced Reactor 2022

05/25/2022

05/24/2022

SMR & Advanced Reactor 2022

05/19/2022

RAPID + tct 2022

05/19/2022

Venture Cafe Roundtable: AI & Healthcare

05/18/2022

Tucson after5 Tech Mixer: World View

05/18/2022

RAPID + tct 2022

More Info

05/18/2022

Signal & Power Integrity Updates in Ansys 2022 R1 - Webinar

05/18/2022

Simulation World 2022

05/17/2022

RAPID + tct 2022

05/11/2022

Experience Stratasys Manufacturing Virtual Event

05/04/2022

Mechanical Meshing Updates in Ansys 2022 R1 - Webinar

Search in PADT site

Contact Us

Most of our customers receive their support over the phone or via email. Customers who are close by can also set up a face-to-face appointment with one of our engineers.

For most locations, simply contact us: