Post subject: Making GIFs for Games Resources
Experienced player (690)
Joined: 11/23/2013
Posts: 2232
Location: Guatemala
Maybe this has been answered already, but... Well, I've been wanting to make gifs for some Games Resource pages, but I don't know how. How do I make them, and how to crop them to a specific region?
Here, my YouTube channel: http://www.youtube.com/user/dekutony
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Record videos with the emulator's built-in video recording function, edit them with e.g. Avisynth, convert to GIF with e.g. Animation Shop (others may know a good free tool).
GoombaHeart
He/Him
Joined: 7/11/2015
Posts: 131
Location: Winters
GIMP works well, I use that. Though there's no preview so you need to work out the gap between frames. You can just use it's crop tools. Though you need a video to JPEG converter.
Shit tier TASer.
Active player (309)
Joined: 8/21/2012
Posts: 429
Location: France
GoombaHeart wrote:
GIMP works well, I use that. Though there's no preview so you need to work out the gap between frames. You can just use it's crop tools. Though you need a video to JPEG converter.
I've used Gimp for the ones I did for the Castlevania page... But no video converter :P In other words, I took screenshots for each frame, and then put them in different layers before converting all of this into a gif... Quite time consuming ^^.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Couldn't taking the screenshots on each frame be automatized with lua or something?
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Warp wrote:
taking the screenshots on each frame
Yes, it's called
creaothceann wrote:
the emulator's built-in video recording function
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
creaothceann wrote:
Warp wrote:
taking the screenshots on each frame
Yes, it's called
creaothceann wrote:
the emulator's built-in video recording function
Does it work if you are eg. rewinding or loading savestates? Just curious.
GoombaHeart
He/Him
Joined: 7/11/2015
Posts: 131
Location: Winters
A coder could probably quite easily make a tool to automatically put them up as layers on GIMP then automatically optimize for GIF.
Shit tier TASer.
Editor, Expert player (2329)
Joined: 5/15/2007
Posts: 3933
Location: Germany
Virtualdub can output gifs. You can use avisynth scripts in tandem with virtualdub to crop and trim videos. It may require some time to learn about avisynth depending what you want to do. http://avisynth.nl/index.php/Main_Page You can then use a page like this http://ezgif.com/optimize to reduce file size if needed. Then you could embed the gif on the game resource pages. You might want to ask one of the site runners (adelikat, Nach) to host the gif on the site. Otherwise it might become a dead image in a few years.
Skilled player (1741)
Joined: 9/17/2009
Posts: 4981
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
GoombaHeart wrote:
GIMP works well, I use that. Though there's no preview so you need to work out the gap between frames. You can just use it's crop tools. Though you need a video to JPEG converter.
JPG's can have animation? Edit: You can preview them:
creaothceann wrote:
Record videos with the emulator's built-in video recording function, edit them with e.g. Avisynth, convert to GIF with e.g. Animation Shop (others may know a good free tool).
Or if it's BizHawk, I recall seeing a record as gif option.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
jlun2 wrote:
JPG's can have animation?
Not jpeg itself, but there's mjpeg, which is essentially just jpeg images appended to each other into the same file (much like animated gifs, really). While major browsers support it, I don't think it's a very popular format.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Step 0) If your content is a 2D game with simple scrolling (not 3D, not parallax), try to figure out and enable cheat codes that remove possible HUDs (such as health bars or score displays) that are always in a certain position of the screen even as the background moves. Step 1) Record AVI in your emulator. FCEUX has it built-in, for instance. Step 2) Convert the AVI file into PNG files. It can be done easily with MPlayer using the following commandline for instance: mplayer -vo png your_avi_file.avi It is also recommended to add a -vf scale=320:240 option (or equivalent) at this point to directly scale the screenshots to whichever resolution you want to use in the article. Step 3) Delete those PNG files you will not want to use in the animation. I use gqview or geeqie for that, but any tool that lets you inspect image files and pick&choose&delete those you don't want will do, including Windows explorer. For GIF size, it may also be be wise to reduce the framerate, by i.e. deleting every even frame, or perhaps even reduce the rate by 3 by deleting 2 out of every 3 frames. Step 4A) If your content is a 2D game with simple scrolling (not 3D, not parallax), use animmerger to align the images together into animation frames with static background. With a static background the GIF will be a lot smaller than if the animation scrolls. For instance: animmerger 0000*.png -pc --gif=always The difference between a normal animation and one with a static background can clearly be seen in these two pictures respectively: original ; stabilized (from animmerger web page). The former image file is three times as large as the latter one. Step 4B) If your content is a 3D game with a moving camera, or it has complicated scrolling, the background can not be made static, but animmerger is still a great way to do high quality dithering for the animation and reduce its color resolution to make a smaller GIF file. For instance: animmerger 0000*.png -pc --noalign -Qd,16 --gamma=2.2 --gif=always As far as I know, animmerger is still the best tool in the world for quantizing and dithering animations with respect to result quality. Sometimes you need to dedicate and spend time finetuning its commandline options to get the most pleasing result though. See --fullhelp for details. Step 5) Merge the individual GIF files produced by animmerger into a single animated GIF file. It can be done with gifsicle, with a command such as: gifsicle -O2 -o combined.gif -l0 -d3 tile????.gif At this point you can also crop the animation further by using gifsicle's --crop parameter. It is highly recommended to crop the animation leaving only the region that contains content relevant to the article. Not only will doing so produce a smaller and thus faster loading file, it will also take less estate in the article and consume less RAM in the browser, making it thrice more mobile-browsing friendly. Step 6) Preview the GIF file in your browser to check it looks allright perfect. If necessary, go back to some earlier step. Step 7) The GIF file must be uploaded to an image hosting service so that it can be linked to on the article page. I don't know the current recommendations on TASVideos about this, so I'll stop here. Back when/then I would put my images directly to the TASVideos media server, but times are different today.
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Just use Home and End to select and delete unneeded frames.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
And here's what it would look like if you followed my instructions: Created like so:
Language: shell

# These three commands just unoptimize the GIF and convert it back into individual image frames: gifsicle --colors=255 7143102.gif > tmp.gif gifsicle -U tmp.gif > tmp2.gif gifsicle -e tmp2.gif # Align the images: animmerger tmp2.gif.* -pc --gif=always # Convert back into an animated GIF (also do some cropping): gifsicle -O2 -o /WWW/kala/snap/kabukianimdemo.gif -l0 -d7 --crop=96,56+300x126 tile*.gif
Input image: 634242 bytes. Output image: 27921 bytes. Below you can see versions that also reduce the color resolution little (25830 bytes) or lot (22922 bytes). animmerger options used to create the second version: -Qb,4 --dc=2 -Dy2 --gamma=2.2
ALAKTORN
He/Him
Former player
Joined: 10/19/2009
Posts: 2527
Location: Italy
^Why do you not let it scroll? Not only is that not how it works, it also glitches the water’s graphics.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
ALAKTORN wrote:
^Why do you not let it scroll? Not only is that not how it works, it also glitches the water’s graphics.
Because it makes a lot smaller GIF files, which load faster, consume less RAM in the browser, and are (arguably) easier to watch because of less noise in the corner of the eye when you're looking at other locations on the page. EDIT: Also, the point is to demonstrate a technique, not to show original game video. That's why some of the images shown at RockmanTricks and SuperMarioBrosTricks are of specially crafted scenes that do not even exist in the actual game. I also just finished building a Windows binary for animmerger. It can be downloaded at: http://bisqwit.iki.fi/src/arch/animmerger-1.6.2-win32.zip
ALAKTORN
He/Him
Former player
Joined: 10/19/2009
Posts: 2527
Location: Italy
Fair enough I suppose…
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Bisqwit wrote:
It is also recommended to add a -vf scale=320:240 option (or equivalent) at this point to directly scale the screenshots to whichever resolution you want to use in the article.
If we are talking about, for example, a NES game, it will originally have relatively few colors (like less than a hundred, if I remember NES's palette size correctly), which would fit perfectly into a gif losslessly, and thus without any need for dithering or other color-destroying techniques. However, if you scale like that, wouldn't it use blinear interpolation, thus introducing enormously more colors to the result, which will thus end up being dithered or otherwise destroyed in the final gif? (Of course unless you are using the original resolution, or an exact multiple of it, it becomes a difficult problem. If you are scaling smaller than the original, then either pixel rows and columns are going to disappear (if you use nearest-neighbor scaling, which preserves all original colors), or lots of additional colors will appear (if you use some filtered scaling). Likewise if you are scaling larger than the original, then either pixel rows and columns will be unevenly duplicated (if using nearest-neighbor) or blurred and thus the amount of color greatly increasing (if using filtering). Optimally the original resolution should be used if you want to preserve all the original colors losslessly in the final gif.)
Experienced player (690)
Joined: 11/23/2013
Posts: 2232
Location: Guatemala
O_o Ok... Thanks for all those instructions everyone...
Here, my YouTube channel: http://www.youtube.com/user/dekutony
ventuz
He/Him
Player (125)
Joined: 10/4/2004
Posts: 940
MUGG wrote:
Virtualdub can output gifs.
feos wrote:
{img} Just use Home and End to select and delete unneeded frames.
I had been messing with making gif a bunch a few years ago. I can tell you virtualdub output to gif is poor result. Doing export -> image sequence, then open them in GIMP (or whichever you prefer) then optimize gif and save gif from there is better. But just use Bisqwit's method, it is far better with less moving parts because moving parts gets replaced uses more memory.