Gif-Making Tutorial

Post all your wacky zany pony media here. (Music, fanart, videos, avatars, gifs, et cetera.)

Moderators: Geomancing, Westy543

Re: Gif-Making Tutorial

Post by Scuderia Ferrarity (?) » Tue Jun 07, 2011 7:56 am

Path selections aren't a feature of Paint.net :(



One other thing I'd found.
So sometimes youre working with macro block madness. But you need to squeeze out that extra few kb to fit within some limit. Jpg is making a mess of the cartoon

Image

Making large innocuous areas a solid color sometimes helps.
Select with Magic Wand, adjusting tolerance as necessary, and use flood fill.
Image

too much tolerance and it plays havoc on the anti aliasing between colors, but it doesn't matter if you're resizing.
Image Image :allears: "Wish I had a unicorn."
Freeze Frame Theatre
Scuderia Ferrarity
User avatar
Fashion Queens
Joined: Feb 14, 2011

Post by Artificer (?) » Tue Jun 07, 2011 8:03 am

Oh God Scuderia. Your avatar and sig is awesome.


Generally how long does an SA avatar take to make? Say, an animation heavy one?
Image
Artificer
User avatar
Goes well with All Natural Milk Naturally Flavored with Natural Flavors.
Stare Masters
Joined: Mar 01, 2011
Location: 80,000 feet above sea level and climbing.
Gender: Male
  • Website

Post by Grue (?) » Tue Jun 07, 2011 8:05 am

GIMP has paths and is free. They work a bit differently from Photoshop, but I'm pretty sure it has the same basic features.
Image
Grue
User avatar
kinda magical
We Like Spike
Joined: Apr 09, 2011
  • Website
  • Website

Post by Kitfox88 (?) » Tue Jun 07, 2011 11:17 pm

Artificer wrote:Generally how long does an SA avatar take to make? Say, an animation heavy one?


The most time I've spent on one so far was an hour, and that was mostly just busywork of ripping frames and then placing them in photoshop, combined with manually removing a few things like another pony's hair flipping into the last frame or two or something like that. But I'm not really super good at this like the others so I may be an outlier. :flutterdear:
Kitfox88
User avatar
phenomenal prevarication
potentate pony
Rarity's Roughnecks
Joined: Feb 17, 2011
  • Website

Post by HOT SQUATS (?) » Wed Jun 08, 2011 7:50 pm

babby's first .gif

Image
HOT SQUATS
User avatar
Joined: Feb 14, 2011

Post by Redeye (?) » Wed Jun 08, 2011 8:21 pm

HOT SQUATS wrote:babby's first .gif

Image



I still love how they're ashamed of themselves/each other for the ludicrous story.
Redeye
User avatar
I was a fan of ponies BEFORE it was cool
Special Flowers
Joined: Feb 14, 2011
Gender: Male

Post by Throbulator (?) » Wed Jun 08, 2011 11:11 pm

Well, I tried out vector masking, and I don't think I could have gotten a better result if I'd gone for pixel masking.

Image
The gif is 13 frames long, with each frame taking me about 10 minutes to mask. :vomitpony:
Image
* Willsun was kicked by Willsun (THROB'S REPORT CARD: Biology (B-), Chemistry (C+), Geometry (B), PONIOLOGY (A+++))
Grilox wrote:"Yes Grilox would have an avatar of the worst scene in ponies of course" - Throbulator, 2012
Throbulator
User avatar
hello.jpg
Honorary Wonderbolts
Joined: May 18, 2011
  • Website

Post by Momar (?) » Thu Jun 09, 2011 4:26 am

Image

Hey look it's done!

Now for an important lesson on compression. Normally, GIFs should be optimized. Namely, it doesn't make economical sense to redraw the same frame over and over and over. Normally, what will happen is each frame will be mostly transparent, with only the pixels that have changed being drawn. So naturally, pictures with a lot of movement don't compress well, and neither do GIFs where you want a transparent background... because then you're forced to redraw every frame.

So... what can we do to compress a GIF?
  • Reduce the number of frames
  • Reduce the colour palette
  • Reduce the overall dimensions
  • Reduce the amount of the image that moves


Frame Removal
Let's examine frame removal for a second. Note that when you remove frames you want to take care to remember that the first and last frame of your selection are adjacent. Unless you want a hitch in her step, adjust accordingly. We're at a 0.04 second frame delay, and you never want to push it far past 0.1 or things get choppy.

Image
Original. 112.13 kB

Image
Every 2nd frame. 60.4 kB

Image
Every third frame. 39.66 kB

You won't get such huge savings on a non-transparent GIF, but it's another good way to cut the costs. However, that last one looks too choppy to be nice.

Image
Better if we speed up the frame delay, but still noticably choppy. She's also got a hitch in her step because it's a 25 frame loop and that doesn't divide evenly into 3. A good rule of thumb for GIFs is you never want to push the delay past 100ms in what is supposed to be a fluid motion, and every third frame is only doable in certain situations.


Reduced Palette
To better understand how we can reduce size through palette, we need to know a couple of factors. First, for every GIF you have a palette. Essentially, it assigns each colour in your palette a number and references them in a table. In the image data that follows, each pixel's colour is referenced by its number, rather than its RGB value. That's because a single RGB colour code (like #BF8040) is 24 binary bits long. In a 256-colour palette, each palette entry is an 8-bit-long number.

Second, pixels that use the same colour are grouped together if they're next to one another. The GIF compression is smart enough to say 'the next 40 pixels are this colour' as opposed to stating the same colour for each pixel in the run.

Now there are three ways in which reducing the palette can reduce your overall size. First and foremost is by reducing the number of bits that each colour can be represented by. This is far and away the biggest space saver. If you go from 256-colours to 128 colours, you suddenly only need 7 bits to represent your colours. Each time you cut the number of colours in half, you can save (at maximum) 1 bit per pixel. All those bits add up, and we need every last one.

The second way you can get some savings is by image smoothing. If you look at a 256-colour palette for a GIF like this, you'll see a LOT of shades of what looks like the same colour. We're actually swapping colours in areas where there is no visual benefit Remember that GIFs compress runs of pixels with the same colour. With a pony like Fluttershy, we essentially have six colours: Two in the mane, two in the coat, four in the eyes (black and white count). However if you cut back colours too much, you'll start to notice the image get ugly. Remember, the ponies have gradients in the eyes, and the outlines where they blend into the background have gradients too. If you're dealing with a single pony and a simple background, you can generally get away with 32 before it gets ugly. We're lucky, because we have no background! We might be able to do 16...

The third way you can get some savings has to do with image smoothing again. If you look at an optimized GIF, on occasion you'll see areas of perfectly unmoving background being redrawn every frame. This is because video codecs aren't perfect, so you're taking a flat colour in a vector flash and converting it to a million-colour pixel representation. You're going to have pixels that look the same to the naked eye but not the same to a GIF optimizer. Anyone who's ever worked with an artifacty youtube rip knows what I'm talking about. By flattening the palette, you'll get rid of these visual differences and the image will hopefully optimize better. Though since we're not optimizing this gif, it's moot for this one.

Image
64 colours. 112.13 kB

Image
32 colours. 84.88 kb

Image
16 colours. 68.38kb

Now, putting A and B together...

Image
16 colours, every 2nd frame, 32.91 kb.
HNNNNNNNNNNNNGGGGGGGGGGGGGGG

Image
11 colours. 29.21 kb. Not bad, but can we do better?


Overall Dimensions
125x125 = 15,625 pixels.
120x120 = 14,400 pixels. Savings, 1,225 pixels.

Image
16 colours, every 2nd frame, 125x125, 32.91 kb.

Image
16 colours, every 2nd frame, 116x116, 28.68 kB.

I am anal and every avatar I make is 125x125, though. So deal with it.


Reduce the amount of the image that moves
There are two ways to get about doing this. First, you can change the framing of the GIF. Take this one for example.
Image
Over 100 frames and clocks in at under 30 kb. To prevent pixel artifact thrashing, I also made sure to put a static shot of that tree on an overlay. Not much we can do about that in this one, though. Those broken wings prevent us from zooming out unless I repair them.

The other way to reduce the amount of the image that moves is to add letterboxes, but again, there are only so many things we can do with a clear background.

Out of curiosity, though, I managed to get this...
Image
21 colours, 125x125, every 2nd frame, 29.46 kB

I can stitch the wings back together, and I think it'll look better than the 11-colour version. You do lose a few facial details in zooming out, though. That's a project for another night, at any rate. I'll put them both up in the AV thread and let the client decide. Don't you know the client's always right? Image

Edit: Turns out the wings are perfectly symmetrical. It'll be a 20-minute fix.
Momar
User avatar
OkayguesswhoIamnow...

HOWDY Y'ALL AH'M GONNA GO BUCK SOME APPLES!
Applejack Aces
Joined: Feb 15, 2011
Gender: Genderqueer

Post by Orange Fluffy Sheep (?) » Thu Jun 09, 2011 5:21 am

I now have a new appreciation for your works, Momar. By the way you churned them out sometimes I didn't know it would be that much work.

Especially for a crazy gimmick avatar like mine.
Orange Fluffy Sheep
User avatar
ABANDON THREAD
Rarity's Roughnecks
Joined: Feb 17, 2011
Gender: Male

Post by VoidChicken (?) » Thu Jun 09, 2011 6:22 am

:awesomedash:

That is all.

Fake edit: Momar avatar god status: still an avatar god.
VoidChicken
User avatar
Stare Masters
Joined: Feb 19, 2011
Gender: Male

Post by Grue (?) » Thu Jun 09, 2011 7:02 am

By the way, you can set up different delays for each frame of the gif. So you can remove more frames for some parts, but less from the others, and adjust the frame lengths accordingly. I.e. if you want smooth eye blinking, you just have to preserve each 1/24 frame. Most of the cartoon is in 1/12 though, so you can safely discard every other frame.

Also another compression tip: in my current avatar I did GIMP's Unsharp Mask on every frame to bump up the contrast, but that caused pixel differences all over the area of the avatar even though most of it is static. So, after optimizing, the difference layers are larger than they have to be. So, I just cropped them to the area of actual sparkling. This is basically Momar's "Reduce the amount of the image that moves" tip, except you might not notice that something "moves" when it's not really supposed to.
Image
Grue
User avatar
kinda magical
We Like Spike
Joined: Apr 09, 2011
  • Website
  • Website

Post by Kitfox88 (?) » Thu Jun 09, 2011 11:20 am

And Momar reveals why more or less every avatar I've ever posted in that thread is little more than some sort of simple expression change or single small body loop, because jesus christ it's a ton of work to do anything else and I'm so lazy. :ohrarity:
Kitfox88
User avatar
phenomenal prevarication
potentate pony
Rarity's Roughnecks
Joined: Feb 17, 2011
  • Website

Post by Liska (?) » Fri Jun 10, 2011 6:08 pm

Anypony here use ImageReady to export their gifs? I ran into an interesting anomaly with the Transparency checkbox. If I disable Transparency on export, the resulting gif is much larger than if I left it enabled (but have no transparent pixels present).

Other than the timing, these two images are the same in dimensions and color depth. Yet one is more than twice the size of the other. Is there any rhyme or reason as to why having transparency would make things smaller, or is that more likely a bug with ImageReady?

Image
125x125
256 color
33 kb


Image
125x125
256 color
14 kb
I'm Image
Liska
User avatar
clop clop clop clop
clop clop clop clop
clop clop clop clop
clop clop clop clop
Faithful Students
Joined: Feb 14, 2011
Location: Ponyville
Gender: Female
  • Website

Post by The great M (?) » Fri Jun 10, 2011 6:17 pm

Liska wrote:Other than the timing, these two images are the same in dimensions and color depth. Yet one is more than twice the size of the other. Is there any rhyme or reason as to why having transparency would make things smaller, or is that more likely a bug with ImageReady?


Maybe turning off transparency means that the gif won't get optimized for overlapping pixels, meaning every frame is fully stored, instead of only the pixels that change for each frame.
The great M
User avatar
Pinke Torte das Pony.

---
Faithful Students
Joined: Mar 17, 2011
Location: Austria

Post by Kitfox88 (?) » Fri Jun 10, 2011 7:46 pm

Yeah, if it's transparent the gif only has to store pixels that change between frames, and if it's not then you have a bunch of full avatar sized frames. It's also why things like the pinkie stares from Party of One optimize wonderfully, because it more or less only needs to slide a few pixels consisting of her eyebrows and eyes. Compare it to basically any scene with say, Rainbow Dash flying, and then you're also worrying about her damn wings going everywhere. Suddenly something with way less frames takes up way more room, just because those fewer frames have way more changes between each, so they don't optimize for animation nearly as well. :spike101:

Image
Image

this is all more or less self taught so it's probably totally wrong
Kitfox88
User avatar
phenomenal prevarication
potentate pony
Rarity's Roughnecks
Joined: Feb 17, 2011
  • Website

Post by Momar (?) » Fri Jun 10, 2011 7:54 pm

Nope, you're absolutely correct. Turning off transparency is also a good way to matte an already-transparent GIF, though the only upstroke to that is it'll look good on both dark and light backgrounds.
Momar
User avatar
OkayguesswhoIamnow...

HOWDY Y'ALL AH'M GONNA GO BUCK SOME APPLES!
Applejack Aces
Joined: Feb 15, 2011
Gender: Genderqueer

Post by Liska (?) » Fri Jun 10, 2011 8:04 pm

Gotcha. I figured that option was purely an alpha-channel thing, and not a delta compression kind of thing.

But now I know. And Knowing Is Half The Battle. :jingo:
I'm Image
Liska
User avatar
clop clop clop clop
clop clop clop clop
clop clop clop clop
clop clop clop clop
Faithful Students
Joined: Feb 14, 2011
Location: Ponyville
Gender: Female
  • Website

Post by Momar (?) » Wed Jul 27, 2011 6:25 pm

r.t. wrote:Here's my second serious attempt an making myself an MLP AV. It turned out much better than the first one :yay: , but it took waaay longer than it should have.
Image
I'm posting it here to get whatever constructive criticism you guys may have. Some problems I can already see:
-Fluttershy is moving in her chair (and part of the chair moves too). This was part of the original animation though, so eh.
-The colours seem to be a bit off. Momar, how do you manage to get the palettes on yours so perfect? What source videos are you using, and how do you make the colour indexer preserve the most important colours?


First off, the reason I get such a good colour is because I import the videos directly into Photoshop. Stepping through a secondary program can cause some palette degradation, especially if it's saving them as JPEGs. Did you do a direct png rip? If you use AVIdemux, uninstall it, and salt the sectors of the hard drive where it lay. Seriously, I don't think there's a program that destroys the colour more. If you're using the png dump technique as mentioned in this thread, good for you.
Second, the masked background presents two big problems. First, it makes it absolutely necessary to have each frame drawn in full. Masking the background will usually make something harder to compress, except in instances where the background itself moves. Generally, the way the show is drawn, backgrounds don't detract from the overall visual style of the avatar, and by having optimizable gifs, you can put that much more space allocation into palette selection. The other problem with masking the background is that with a gif, you get matting. Either you have a transition-to-white or transition-to-black blend for semi-transparent edge pixels, or you get a visible jaggy gif edge. Matting isn't that big a deal since we use a light-background theme, but bear in mind that some of the theme contest entries have some bolder backgrounds. In this particular shot, I can't see much reason not to use a static background, other than personal preference, which is fine.
Also, don't be afraid to tweak the palette manually. KefkaFloyd has provided a wonderful colour matching guide. It's a lengthy process, but if you're only making a couple and want to really pour on the quality, it's a possibility.

Now, as for the unwanted motion... This is a technique I use all the time, because these ponies are incredibly animated, even when I don't want them to be. Take Ohlookasock's current avatar.
Image
I literally pasted a static image with a hole in it where the moving hoof goes. Not only does this make it compress REALLY well, but it removes a lot of extraneous motion that can make the gif look visually worse or prevent it from looping. Cutouts also eliminte any artefact-induced deoptimization.

For this particular image, I'd make two cutouts. One of the chair back, armrest and the left half of Fluts' body when her hair is at the lowest frame of the nod. Make the other one a cutout of the right side at this same frame. Then, once you've got the cutouts lined up, trim the second one back as fluttershy's hair moves forward. It won't be 100% seamless, but if you're using a huge HD rip, it shouldn't matter at all once you size it down. Any minor line breakage may be apparent to you, but the rest of the forum haven't pored over it with a fine toothed comb like you would have. You can also use this technique to blot out any background motion you may be encountering, though I'm not sure there is any in this instance.
Momar
User avatar
OkayguesswhoIamnow...

HOWDY Y'ALL AH'M GONNA GO BUCK SOME APPLES!
Applejack Aces
Joined: Feb 15, 2011
Gender: Genderqueer

Post by r.t. (?) » Thu Jul 28, 2011 7:02 pm

Thanks for the response!

Momar wrote:First off, the reason I get such a good colour is because I import the videos directly into Photoshop. Stepping through a secondary program can cause some palette degradation, especially if it's saving them as JPEGs. Did you do a direct png rip? If you use AVIdemux, uninstall it, and salt the sectors of the hard drive where it lay. Seriously, I don't think there's a program that destroys the colour more. If you're using the png dump technique as mentioned in this thread, good for you.

I've been using MPlayer to rip pngs, so hopefully I'm not getting loss from that. The source videos I'm using are allegedly 1080p. On a related note, those videos are MKVs, and earlier in this thread you mentioned a hatred for them, but I'm not sure what difficulties they cause. What benefits would I get from using Handbrake to convert them first?

Second, the masked background presents two big problems...

Yeah, the masked background was a bit of a blooper :nngh:. I had a couple of reasons for it, partially preference, partially because the background had flying particles (bird feed) in it, and partially because I got turned around on exactly what having a transparent background would mean for a gif. I knew about the transparency optimization that gifs use, but I somehow failed to make the connection that it wouldn't work if the backgound was itself transparent.

Now, as for the unwanted motion... This is a technique I use all the time, because these ponies are incredibly animated, even when I don't want them to be...

Thanks for this! I'd read your tutorial in this thread, so I knew about the cutout trick, but I couldn't figure out how I could apply it cleanly to two overlapping and independently moving objects. I don't know if I'll go back and redo the whole gif, but I think I'll at least try your suggestion on a few frames for practice.

This gif making is pretty interesting stuff. It's probably a good thing I take so long and so much effort to make one though, otherwise I might end up making new avatars constantly. That wouldn't be a good idea for two reason, first and foremost being that I don't want to become a competitor to you, Momar. You do good work, and while I prefer to make my own avatars, some of the ones you've posted had me sorely tempted. The second reason is that I like to get some good use out of an avatar, but if I were always making new ones I'd want to use my latest and greatest all the time.

Oh, and as a small contribution to the thread, if anyone is trying to shrink a gif down just that last 1 or 2 kilobytes, try running it through GIFsicle. It's a command line based tool for manipulating GIFs, and it's got a pretty aggressive optimizer built in. It can't always do much (or anything) when you're already using an editor with good compression techniques like GIMP, but there are a few cases where I've gotten GIMP optimized gifs down a couple or even just a fraction of a kilobyte, which may come in useful. Warning: it's written for Linux, and I've only used it in either that or Cygwin, so I don't know how well the Windows port there works.
copy this in your sig if find appreciate redeye to the other mods of *bro
Image - Canadian Chapter ImageImage
r.t.
User avatar
Rush hour is terrible everywhere.
Stare Masters
Joined: Jun 21, 2011

Post by Scuderia Ferrarity (?) » Sat Oct 01, 2011 3:45 pm

Don't you know this big beautiful hunk of a thread is a DIAMOND! :wat:
Image Image :allears: "Wish I had a unicorn."
Freeze Frame Theatre
Scuderia Ferrarity
User avatar
Fashion Queens
Joined: Feb 14, 2011

Post by numsOic (?) » Sat Oct 01, 2011 7:19 pm

Yo, Grue, what the fuck up, wanna write a GIMP tutorial with me?

I honestly wouldn't be able to write a tutorial for any one program as my process almost always involves at least three different programs, so I only know certain things about each regarding GIFs. What I do with GIMP involves removing all the noise and artifacts for optimization, which it's good for due to its dealing-with-frames-as-layers system.

Also, I can vouch for rt's suggestion of using GIFsicle. It's now permanently embedded into my personal process. It even has a Windows version so there's pretty much no excuse.
numsOic
Stare Masters
Joined: May 21, 2011
Location: Argentina
Gender: Male

Post by Grue (?) » Sat Oct 01, 2011 7:51 pm

Funny you should say this, because I actually started writing the gimp gif tutorial earlier today. I've got the basic stuff so far, up to creating and optimizing a large gif from video frames, and it's quite detailed, and I've yet to go in depth on various editing techniques. I'll try to post what I've got during the weekend.
Image
Grue
User avatar
kinda magical
We Like Spike
Joined: Apr 09, 2011
  • Website
  • Website

Post by The great M (?) » Sat Oct 01, 2011 7:54 pm

A gimp tutorial would be cool. I've been using it for a while now and I got all the basics down, but some more advanced techniques would be good to know.
The great M
User avatar
Pinke Torte das Pony.

---
Faithful Students
Joined: Mar 17, 2011
Location: Austria

Post by Grue (?) » Sun Oct 02, 2011 12:20 pm

Grue's Gnarly GIMP GIF Tutorial, part 1

So, you want to make gifs of ponies. However you're a cheap/poor bastard and you can't afford Photoshop. Thankfully there is free software that can do many of the things Photoshop can do. I'm of course talking about GIMP (formerly known as The GIMP). In this tutorial, you're assumed to be a total noob who never touched GIMP before. However, some common sense is expected. Just stick to the program, and you'll be making gifs in no time. This tutorial is for GIMP 2.6.11. GIMP 2.7 is a development version and is not stable enough for regular usage.

Exporting Frames From Video
The first step you need to do is to get high quality frames from the video. There are several ways to do that, but they are all rather clunky. I'll describe my preferred method below.

mplayer method

Mplayer is a command line video player. It can be downloaded here. The version with GUI (SMPlayer) is recommended, but we actually don't need the GUI. Either way, what you need is to install it, and find where the file "mplayer.exe" is located (in GUI version it's placed in a sub-directory).

Image

Now, create a directory somewhere else that would contain the frames we capture from the videos. Create a file called "frames.bat" that contains the following:

Code: Select all
cd /D {path to the directory you just created}
{path to}\mplayer.exe -vo png:z=9:outdir={subdir} -nosound -ss {start} -frames {number of frames} %1


{path to} is a path to mplayer.exe.

{subdir} is the name of subdirectory where we put the frames. Because you don't want them all in the same place, it can get confusing!

{start} is the approximate start time where you want to start capturing frames. It can be either a number of seconds from the start or in the form mm:ss with minutes and seconds.

{number of frames} is the number of frames to capture. There are 24 frames per second, so calculate accordingly.

Finally, the fun part. This method doesn't actually require messing with command line. You take the source video file and drag it onto the .bat file we just created. This should launch mplayer.exe with the right command line parameters and create a bunch of frames in subdir. Next time just edit frames.bat with the different parameters and drag another video onto it.

Selecting the right frames
Create another directory and put the frames that you want to have in your GIF in there. Working with more than 30 layers in GIMP is a pain, so choose wisely (besides, your final gif shouldn't have that many frames anyway). Most of the time, you can skip every second frame, unless something fast happens (like blinks) and you need to capture that. You can always delete the unneeded frames later, so if you're unsure then just grab them all.

For this tutorial I chose consecutive frames of the part where Rarity karate-kicks Applejack in S2E02. You can download them here.

Importing frames into GIMP
Select File > Open as Layers... , go to the directory where your chosen frames lie, then select all of them and open. (note: File > Open... dialog looks exactly the same and will open each frame in a separate window. This is bad! If you accidentally do this, click File > Close all)

Your layer panel should look like this:

Image

If you scroll to the bottom, you will notice that the bottom layer is called "Background", which is kinda dumb. This is not necessary, but if you're feeling OCD like me, you can rename that layer to it's original frame number. To do that, double-click on the name of the layer and you can change its name to whatever.

How to work with layers
You may have noticed that no matter which layer you select (by clicking on it), the image window shows only the contents of the top layer. This is in fact an expected behavior when you're editing a "normal" image (not an animation). You place layers on top of each other, perhaps having transparent areas and the top layers take precedence. In our case, the top layer is completely untransparent and it blocks the view of all the other layers.

You may have noticed the "eyes" on the left of the layer toolbox. They control which layers are visible. By clicking on them you can hide/show individual layers. But what if we want only a single layer to be visible? The trick is to Shift-click on the eye icon for that layer. By shift clicking you can see each individual frame in your animation.

Note that selected layer and visible layers are independent concepts. Most of the actions you perform are applied only to the selected layer. But it might not even be visible.

Keyboard shortcuts
Some of default shortcuts that have to do with layers are PgUp and PgDown, which work when the image window is active and select previous/next layer. They don't change visibility at all. For a long time, I just lived with that, changing visibility manually, but while preparing this tutorial I found a better way.

This plugin adds several actions that both change the selected layer and make it the only visible layer! Which is generally what we want when working with animations. To install the plugin, select Edit > Preferences, go into Folders > Scripts and note the folder names that are in the list. Download the plugin file and put it in one of these folders. Then go to Filters > Script-Fu > Refresh Scripts and you should see commands like "Layer > Stack > Select next layer only" appear in the menu. Failing that, restart GIMP.

But, this is not all. To truly harness the power of these commands, we need to assign keyboard shortcuts to them. Fortunately, GIMP allows to do that, and more. Go to Edit > Keyboard Shortcuts. There's a Search field at the top. Type "layer only" in there and you'll get something like this:

Image

Unlike me, you have no shortcuts assigned to these commands yet, so click on each of them and press the corresponding key combo.

While we're here, let's see what other fun things we can do. I assigned Ctrl-Del to "Delete Layer" (something you have to do a lot when you are trying to make gif smaller), Insert to "Visible", and lots of other things I don't remember right now. If you do some action often, it is usually a good idea to assign a shortcut to it. Fortunately, GIMP will warn you when you try to overwrite an existing shortcut.

Basic navigation
When you load an image into GIMP, it may be zoomed out to fit your screen. To bring zoom level to 100%, press 1. You can use Zoom tool (Z) to zoom in/out on your image (to zoom out you have to Ctrl-click). Press Space and move your mouse to pan around the image.

Cropping (static)
Usually you want to only have a part of the frame in your final gif. Suppose the object you want to focus on doesn't move around much, so you can just cut a specific section from each frame and that's it. There are two ways to do this.

Crop tool (Shift-C)
Crop tool does basically what it says. You select a rectangle, then click inside it (or press Enter), then boom: every layer is cropped. You can resize the rectangle by dragging its sides and corners, or drag it around in order to frame things perfectly. One option that might be useful is "Fixed". You can add various constraints to the dimensions of the crop. If you want a square, select Fixed Aspect ratio and enter "1:1" into the nearby text field. You can switch layers after you selected a crop area, so make sure that you're cropping the right thing in each frame of the animation.

Rectangle Select tool (R)
This tool is used for things other than cropping, so it's useful to get acquainted with it. The process of selecting a rectangle is similar to the crop tool. You can also set Fixed aspect ratio in pretty much the same way. To actually crop the area that you selected, go to Image > Crop to Selection.

By the way, if you have a selection, everything outside of it is usually protected from editing. To remove selection, go to Select > None, or press Ctrl-Shift-A.

Preview Animation and save

Go to Filters > Animation > Playback and make sure it "looks good, bb". Then go to File > Save As... and no, don't save as GIF. Save it as XCF (GIMP project). In fact, if you leave out the extension, GIMP will save it as XCF by default. It is a good idea to save intermediate steps to different files so that you can start over if you realize that you messed up at some point. Unless you're actually trying to get a GIF, never save as GIF, because it's a lossy format and you won't be able to recover everything if you load it later.

download xcf

But I want to save as GIF!

Let's say you don't care about the dimensions, or size, or how long each frame should be shown. You just want a quick GIF. In order to do this, select File > Save a Copy. This time the filename should end with ".gif" or select GIF from the list of possible formats. You'll get a dialog with several choices. You obviously want "Save as Animation". As for that Indexed thing, this will be explained later. For now just select it. But wait, that's not all! There is another dialog.

Image

Since we didn't specify the duration of each frame, this is the place where you enter it. There are approximately 24 frames per second. So each frame lasts approximately 40 milliseconds. If you removed every 2nd frame, the delay should be 80 milliseconds. But sometimes you want to slow the action down if it happens too fast in the original source. In that case just enter a bigger value. Press Save and you'll get a good quality, but rather large GIF.

my first gif

Simple optimization

You can dramatically reduce GIF size if you perform the following 2 operations first:

Indexing

By default, GIMP works with images in RGB mode. This means that an image can have up to about 17 million different colors. Most image formats (like JPEG, PNG) support that many colors. But GIF is different. GIF supports only at most 255 different colors per image (well, this is technically not exactly true, but for practical purposes...). An "Indexed" image in GIMP means that it has a fixed palette of several colors, just like GIF images. Many functions don't work with Indexed images, so you will usually convert to Indexed just before saving to GIF. Select Image > Mode > Indexed...

Image

When you save an RGB image to GIF, GIMP automatically converts it to indexed with 255 colors. You can try 127 colors, for example, then play animation and see if it looks much worse. The less colors you have, the smaller the resulting GIF will be.

You can undo converting to indexed by pressing Ctrl-Z, and maybe try again with different number of colors.

Optimize for GIF

This filter uses various tricks with layers intended to minimize the size of the resulting GIF. Just select Filters > Animation > Optimize for GIF and you'll get a new window with modified image. You will notice the layers now have transparency in them. Also you will notice that they have "(100ms)" in their name. This means the filter has set the delay of each frame to 100ms. I don't really know why this happens, but if you don't want to manually change the delay for each frame, just check "Use delay entered above for all frames" when saving this GIF.

optimized gif

You can see that this gif is half the size of our first attempt. Still pretty big, but well... it's a big gif, not an avatar.


Resize

OK, now we want this avatar-sized. Make sure you aren't in Indexed mode and undo it if you are. Select Image > Scale Image and set width to 125. Since we cropped to a square image, the height should also be 125. Press 1 to set zoom level to 100%, and see if the frames look blurry. Usually it shouldn't be a problem, but let's say you want to bump the contrast a bit. Select the topmost frame. Select Filters > Enhance > Unsharp Mask

Image

You can use my values or try to tweak them. Now, you basically have to apply it to every frame. Once you did the topmost frame, use PgDn to go down the list and press Ctrl-F to repeat the last used filter (that is, Unsharp Mask). You don't need to bother making each layer visible, this filter will happily modify your layers even if they are not visible. Just don't apply it twice on the same layer, that would be bad.

Do an animation preview and SAVE this file as (a different) XCF.

download xcf

Removing unneeded frames

So far in my example there's 22 frames. This is too much. There's no way they all fit under 30kb. Let's start reducing it by at least a factor of 2. Go through every layer starting from the bottom (by pressing Ctrl-PgUp) and observe which frames look similar enough that we won't miss them being deleted much. Mercilessly delete them (Ctrl-Delete). With just 10 frames we're in fact very close to success. In fact, converting to Indexed with 31 colors, optimizing for GIF and saving as GIF produces an image under 30kb:

Image

xcf

Manual timing

I saved the above avatar with 80ms delay for each frame. However, this isn't how it should be. Look carefully at your layer list:

Image

The gaps in frame numbers give us a hint what delays should be. As was already mentioned, the delay between two consecutive frames is 40ms, so if there's a gap of one frame, it's 80ms and so on. Now, to actually set the delays. Rename each frame by adding "(80ms)" or "(40ms)" to the end of its name. The last frame... Since this is a non-looping gif, make it last. 500ms should be enough.

Image

Test it with animation preview. Save as XCF again. Convert to Indexed, optimize for GIF, save the result as GIF. This time make sure to uncheck "Use delay entered above for all frames"!

Image

This looks... decent enough. Would probably look better with less frames and more colors, but the basic idea is there.

It was a simple gif though. The background is static, and the area we cropped was also static relative to the video frame. We also didn't have to seamlessly loop it.

Killing artifacts

It is often possible to reduce gif's size by messing with an already optimized gif. Sometimes you can eke out a few bytes you need to keep it under 30kb. Or maybe even a lot. You never know. Let's start with the second frame from the bottom. There is some weird stuff to the right of Applejack when background is supposed to be static! Select Applejack with a rectangle tool, then Layer > Crop to selection.

Image

Proceed with the other layers, but be careful - sometimes you can delete something important. Make sure to preview the animation so that everything still looks good. There isn't really much in this particular gif to cut out (aside from frame 2 and frame 4), but we still saved about 250 bytes.

Image

to be continued...
Image
Grue
User avatar
kinda magical
We Like Spike
Joined: Apr 09, 2011
  • Website
  • Website

Post by Grue (?) » Sun Oct 09, 2011 1:12 pm

Grue's Gnarly GIMP GIF Tutorial, part 2

Hello, it's me again! I'm sure all of you are extremely excited about this. *crickets*

In this part I explain a few more gif-making tricks in excruciating detail. Last time I spent a whole chapter making a gif out of one scene. Fasten your seatbelts, because this time we're making a grand total of 3 (three) gifs in quick succession, each explaining a particular aspect of the art of gif-making. What fun!

Making it loop

Suppose you want to make a gif of some magic effect, like the one Celestia does at the end of Return of Harmony pt.2.

Image

download xcf

You may notice a few problems with this gif. The major one is that it doesn't loop. The transition looks jerky and terrible. It's not hard to fix, and we will do this later. The minor, but annoying one is that parts of Applejack's hat and Twilight's horn are appearing at the bottom. To fix this, I just manually edited the frames where they appear. Switch to Paintbrush tool, select the size of the brush you're comfortable with, then pick the color by Ctrl-clicking on the image where the color is. Then gently erase the hat/horn with the color that should be behind it. Do this for every frame (make sure it's both selected and visible).

download fixed xcf

Now to make it loop. The concept is pretty simple: add the frames in reverse and the transition becomes smooth. Duplicate every layer except for first and last (Right click -> Duplicate layer), then drag them in reverse order to the top.

Image

Great, now it loops perfectly. Convert to Indexed with 100 colors, Optimize for GIF and save...

Image

Oops, it's too big! But don't worry! The secret is that you don't really need 3 frames to make a smooth transition. In fact, just one, the middle, is enough. In this example, I can delete frames "121 copy" and "125 copy", and it would still look pretty good.

Image

Localizing animation

Sometimes you want only part of your gif to be animated. For example, in this gif Fluttershy loops badly, and it might look better if she doesn't move at all. Or not. Anyway, this is the example I came up with, so I'm gonna roll with it.

Image

download xcf

What to do? First, find the frame with the best looking background (Fluttershy is part of the background in this example!). Frame 33 is best for several reasons: it has no visible Fluttershy wings (it would be weird if they aren't moving), and Dash is at her closest to Fluttershy in this frame so it's easier to cut her out. Duplicate this layer (menu Layer -> Duplicate Layer, or right click on it and select Duplicate Layer) and drag the copy to the bottom of the layer list.

Choose Free Select tool (F) and make a selection that contains the entirety of Dash in every frame and preferably doesn't contain Fluttershy (especially in the basis layer we chose - frame 33).

Image

Unfortunately, Fluttershy does encroach into selection in some frames, but it's not as important as the fact that Dash doesn't go beyond this selection.

Press Ctrl-I to Invert selection (or Select -> Invert). Now, the stupid part. A layer in GIMP can either have or not have an alpha channel. Alpha channel is responsible for transparency. A layer can not have transparent parts if it has no alpha channel. By default, layers we loaded from screenshots do not have alpha channel, so we need to add it to every layer.

Go to Edit -> Keyboard Shortcuts, find the command Add Alpha Channel and assign some keybinding to it (I have Shift-Alt-A, which is perhaps not the most convenient shortcut in the world). Start from the second layer from the bottom (the bottom layer is a copy of frame 33, right?). Press your keybinding to add alpha channel, then press Delete to delete the part inside of the selection. Only Dash should remain on this layer. Then press PgUp, and repeat this for the 3rd layer from the bottom. Do this to every layer except the bottom one. Your layer panel should look like this:

Image

Ctrl-I to invert the selection again. Go through every frame and look for parts of Fluttershy mane. Paint over it with the color of the sky. Now right click on the second layer from bottom and select Merge Down. We do this, because it's supposed to be the first frame in the animation, but it's the second layer from the bottom, so we merge it with our base layer to get the real first frame. Go to Filters > Animation > Playback and check that everything looks smooth.

final xcf

After the usual procedure we get a nice (and small) gif.

Image

Cropping a moving target

Sometimes you want to make a gif centered on a character who moves across the screen. Previously we cropped out all layers at once. In this situation, we need to crop each layer so that each frame is centered on the character. This poses a problem: there is no single reference point in a typical FiM pony model. When a pony moves from point A to point B, there's no part of her that moves linearly. Fortunately there is order in this madness. Watch the hooves. Their positions tend to repeat every few frames (the number depends on the speed of walking). Once you found two frames with similar hoof positions, you have found a walkcycle. Which means that if you do everything correctly, the pony movement will loop.

For the example I'll use a few frames of running Twilight Download xcf with the original frames. This example is interesting because it's not strictly horizontal or vertical movement (as it is in most cases) and it's not perfectly looping. Here is the comparison between the first and the last frames:

Image

You might be saying: these don't look very similar, but they are, in fact, pretty close match for this walkcycle. Front left hooves are both straight and the angle is just a few degrees off. There are no frames in this run that look exactly the same, because Twilight moves very fast here. If a pony walks slowly, you're more likely to find two poses that match exactly. Also, the first frame (the one on the right) doesn't show quite as much Twilight as I'd like, but that's ok! We only need this frame for reference to calculate how much Twilight moved during this walkcycle.

First, make a square selection on the last frame. I like to use reference points, such as the notch in Twilight's mane as the center of selection and bottom of the shadow as the bottom of selection.

Image

By the way, it is possible to save selections for later retrieval, in case you mess something up. It's just not very obvious how to do that. Select -> Save to Channel adds a new "channel" to the channel tab (next to layers, looks like red-green-blue stack). It will be called "Selection Mask copy", though you can rename it. If you need that selection later, right click on the channel and select "Channel to Selection".

Now we need to calculate the offset between the first and the last frame. Use Measure tool (Shift-M) to draw a line between the aforementioned "mane point" on the last and the first frames. In the status line you will see the numbers that show the offset (510x23)

Image

Now, we need to apply some serious math here. We calculated the offset between the first and the last frames. There are 8 frames in total. But there are only 7 "gaps" between them. Which means, to calculate the offset between consecutive frames we need to divide by 7, and not by 8 as one may think.

510/7 = 72.8, or 510 = 7*73 - 1. We can just assume the horizontal difference is 73 pixels, because this one pixel is unlikely to make a difference.

23 = 3*7 + 2. Here the residue is 2, which I suppose might be noticeable. You might want to move two frames by 4 pixels instead of 3. But really, this is not that important.

Now is the hardest part. It is very easy to mess everything up at this point. Start from the top frame, and make sure the selection is there. Now switch to Move tool (M) and switch to move selection mode:

Image

For convenience you also need to assign a keyboard shortcut to Layers > Crop to Selection. I have Alt-` for that.

Now, careful. Every keystroke is important. Switch the focus to the image window and set the zoom level to 100% by pressing 1. First, crop the top layer to selection. Now PageDown to the next layer. We need to move the selection 73 pixels right and 3 pixels up. There are two ways to do this. First is to drag it with the mouse and observe the numbers in the status bar, you need to be pixel perfect there. The second is to use the arrow keys. Simply pressing an arrow key moves the selection by 1 pixel, pressing Shift moves it by 25 pixels at zoom level 100%. So in our case we need to press Shift-Right 3 times, then Left 2 times, then Up 3 times. Once you have moved the selection correctly, crop this layer to selection and press PageDown for the next layer. Do this for every layer except the bottom one. In fact, just delete the bottom layer: as I said earlier we only needed it to measure the distance.

So, each layer is now square sized. But they are aligned all wrong. Shift-click on the eye icon in the layer list once or twice to make all layers visible. Now select Image > Align Visible Layers

Image

Basically you need to "collect" both horizontally and vertically to top left corner. Then Image > Autocrop Image to change the image size to the size of our layers. This is the result:

final xcf

Image

The background doesn't loop very smoothly, but the pony does. However, usually it is worth to fix the background too (which may be hard in this case). I'm going to leave the resizing of this as an exercise. :smug:

In chapter 3 I'm going to explain how to do masking and stuff. To be continued.
Image
Grue
User avatar
kinda magical
We Like Spike
Joined: Apr 09, 2011
  • Website
  • Website

Post by Momar (?) » Sun Oct 09, 2011 5:46 pm

An absolutely stellar tutorial, Grue. I can't wait for part 3 :yay:
Momar
User avatar
OkayguesswhoIamnow...

HOWDY Y'ALL AH'M GONNA GO BUCK SOME APPLES!
Applejack Aces
Joined: Feb 15, 2011
Gender: Genderqueer

Post by Grue (?) » Sun Oct 09, 2011 6:48 pm

Momar wrote:An absolutely stellar tutorial, Grue. I can't wait for part 3 :yay:


Thanks, your praise means a lot to me! :awesomedash:
Image
Grue
User avatar
kinda magical
We Like Spike
Joined: Apr 09, 2011
  • Website
  • Website

Post by The great M (?) » Thu Oct 13, 2011 2:39 am

For those of you who want to use Gimp, here are two more things I've found useful:

Unoptimization:

Filters -> Animation -> Unoptimize

Reverses the optimization (i.e. removal of unnecessary pixels) of a gif. You will most likely need this if you are changing an already existing gif.
Doesn't always work well, especially if pixels were removed manually after optimization.


Reverse gif:

Layer -> Stack -> Reverse Layer Order

Reverses the order of all layers, i.e. the gif. If you are doing this for an existing avatar, you will most likely have to unoptimize first, then optimize again after reversing.
The great M
User avatar
Pinke Torte das Pony.

---
Faithful Students
Joined: Mar 17, 2011
Location: Austria

Post by Pony Factory Factory (?) » Tue Nov 15, 2011 3:02 am

I was asked to post this here over in the main GIF thread, so okay. I'll even clean it up a smidge. :yay:

--

Sometimes, you want to take a pony off a background. You might use the Magic Wand tool to select big areas of color, but there might be a lot of lines or you aren't getting good results. You could create a vector mask, but it's so labor-intensive! Don't you wish there were some way to automatically generate a mask that you can easily edit?

Well, there is. In video editing, it's called the difference key, and it's a technique, like greenscreening, to remove the background of an image and isolate foreground elements. The basic idea is to compare your image with a background template, i.e. an image of what your shot looks like without any foreground elements.

In this example, I'll show you how to use the principle of difference keying to generate a 95%-there layer mask for a frame from an animated GIF using simple steps, which you can then clean up manually. If you're not a fast mask painter, this will be faster than carefully cutting out each frame.

We'll be using this GIF of Sweetie Belle and Derpy, posted in the main GIF thread, as a source:
Image

For our example frame, we'll use this shot of Derpy:
Image

And remove the background to this point without any fiddly, detailed selections or brush work:
Image

Conveniently, the GIF includes a background template:
Image

If it didn't, we would have to build one out of multiple frames from the original animation. Lucky I don't have to cover that, huh? :crack:

N.B. This tutorial was built in Photoshop, written with GIMP in mind, but should also work in Paint.net or what have you - I tried to be general enough.

--

So, to generate the mask for this frame, I have placed the background template into a new image as Layer 1, and I have placed our frame of interest over it as Layer 2. The next step is to set Layer 2's transfer mode to Difference.
Image

Merge/flatten these layers or take a screenshot or something so you have a single-layer copy of that crazy-looking image. Desaturate it so it's black and white.

Higher quality images produce much better results, but if you're working from a low-quality image, you can run filters like Despeckle or Median or Gaussian Blur at this point (not too aggressively) to clean up the image. I ran a Despeckle on this image because the GIF original from last page was saved with dithering.

You'll end up with something like this:
Image

Then adjust the levels to pull up the dark greys so you can see better.
Image

Use the paintbrush tool to get rid of any obvious flaws by painting over them in pure black. No need to be dainty, you can do this again at any point.

Now go to the levels again, and ramp the greys up hugely. You can also bring up the minimum black level to get rid of extra noise.
Image

Go to levels once more, and pull the white input and down so that you're left with a high-contrast black and white image, with white over what you want to keep in the frame:
Image

You can probably accomplish this in fewer Levels applies, but that requires pixel-perfect control of the slider, so psssht.

And then you go back to the original frame, and you give it a layer mask, and you make that mask the black and white image you just created.
Image
(I faked up this set of screenshots before I finished the effect properly, so it's not quite right - it will look right when you do it)

Finally, to clean up, you can draw directly onto the layer mask. White reveals, black hides. You can do grays, too.
You can pause the videos! You can get started NOW with the online videos! You can rewatch the videos in the areas!
Pony Factory Factory
User avatar
sugoi
Semper Pie
Joined: Nov 07, 2011
Location: Boston, MA
Gender: Male

Post by Pony Factory Factory (?) » Tue Nov 15, 2011 3:10 am

Also, if you do have access to a program that can difference key video, it's a great way to visualize GIF optimizing.

Image

A white pixel is a pixel which has changed any amount since the background template. I updated the template at 1s13f so you can more clearly see what happens with Derpy.
You can pause the videos! You can get started NOW with the online videos! You can rewatch the videos in the areas!
Pony Factory Factory
User avatar
sugoi
Semper Pie
Joined: Nov 07, 2011
Location: Boston, MA
Gender: Male

Post by numsOic (?) » Tue Nov 15, 2011 4:45 am

Pony Factory Factory wrote:Image

A good way of achieving the same effect with GIMP (though tedious if you're working with many layers) would be the following:

If your GIF isn't unoptimized, do it now (Filters > Animation > Unoptimize). If you're working on an existing GIF, you'll need to change from Indexed to RGB mode so the layer blend modes will work (Image > Mode > RGB). I'll be working with this GIF:
Image
(It was on my desktop... shut up.)

Open the GIF. Make only the frame you're working on visible.
Image

Make the next frame visible.
Image

Change the blend mode on the top layer from Normal to Difference.
Image

Your image should change from looking like this:
Image

...to this:
Image

Make a new layer from the difference of both (right click on visible layer > New from Visible). You should get a new layer that looks exactly the same but whose blend mode is Normal. Select that layer and threshold it (Colors > Threshold) with the values 1 to 255. The new layer should now look like this:
Image

Do this with consecutive layer pairs (2 and 3, 3 and 4, 4 and 5...) to get all the frames for something that looks like PFF's final result over there. (As you can see, this particular GIF is not very well optimizable without some major editing.)

I literally just made this process up on the spot, so there's probably a better way to do this in GIMP.
numsOic
Stare Masters
Joined: May 21, 2011
Location: Argentina
Gender: Male

Post by Tzar469 (?) » Sun Dec 11, 2011 7:25 am

I need some help guys. I edited the background out of this gif with the magic wand in photoshop:

Image

but now when I save it the gif comes out like this:

Image

Why does it do that? It looks fine if I play it in Photoshop :gonkity:

I'd attach my PSD but apparently it's not allowed.
Tzar469
User avatar
"A thrilling time is in your immediate future."
Applejack Aces
Joined: Oct 25, 2011

Post by numsOic (?) » Sun Dec 11, 2011 7:45 am

Because you're combining frames, not replacing them. You need to change the blend mode of all frames from combine to replace. I don't use Photoshop but there has to be a setting somewhere to change this, probably in the save dialog. The downside of this is that the file is going to be much larger since it doesn't get to optimize away all the pixels that are the same between frames.

Oh, also the frames have a lot of artifacts in the transparent areas, probably from bad masking. Should be easy to clean.
numsOic
Stare Masters
Joined: May 21, 2011
Location: Argentina
Gender: Male

Post by Tzar469 (?) » Sun Dec 11, 2011 8:12 am

Okay, I found the option to "replace" the frames. I had to right-click every frame in the animation timeline and select "Dispose".

I'm trying to get rid of the artifacts right now but I don't know how. I tried using the Eraser tool over where the artifacts are but that's not going so well because I can't actually see the artifacts in the Photoshop window :v:

e: Here's the updated image

Image

e2: Hmm, it looks fine here because the background is a light color but check this link: http://imgur.com/ec2lZ
Last edited by Tzar469 on Sun Dec 11, 2011 8:46 am, edited 2 times in total.
Tzar469
User avatar
"A thrilling time is in your immediate future."
Applejack Aces
Joined: Oct 25, 2011

Post by numsOic (?) » Sun Dec 11, 2011 8:33 am

Strange; the transparent color should look like a white and gray chess field. Still, there has to be a setting somewhere in the configuration to change that to darker colors or even black.

Fake edit: On second thought, you don't even need to do that; just quickly trace over Angel with a freehand selection, invert the selection and delete.
numsOic
Stare Masters
Joined: May 21, 2011
Location: Argentina
Gender: Male

Post by Damathacus (?) » Sun Dec 11, 2011 12:21 pm

Momar wrote:
First off, the reason I get such a good colour is because I import the videos directly into Photoshop. Stepping through a secondary program can cause some palette degradation, especially if it's saving them as JPEGs. Did you do a direct png rip? If you use AVIdemux, uninstall it, and salt the sectors of the hard drive where it lay. Seriously, I don't think there's a program that destroys the colour more. If you're using the png dump technique as mentioned in this thread, good for you.


Photoshop wants me to install QuickTime before it can import videos and I'll rather hit my dick with an hammer than install that PoS, is there way around that?
Also how much quality do I lose if I use MPlayer to make .png frames when compared to importing directly into PS?

On related note, I made my self an avatar. It's bit choppy but I'm still learning this stuff :gotcha:.
Damathacus
User avatar
Night Mares
Joined: Sep 27, 2011

Post by numsOic (?) » Sun Dec 11, 2011 5:55 pm

Damathacus wrote:Photoshop wants me to install QuickTime before it can import videos and I'll rather hit my dick with an hammer than install that PoS, is there way around that?
Also how much quality do I lose if I use MPlayer to make .png frames when compared to importing directly into PS?

If you're saving directly as PNG and you have no visual filters on, you shouldn't lose any color or quality.

Also, nice avatar. I actually thought Momar had already started doing requests.
numsOic
Stare Masters
Joined: May 21, 2011
Location: Argentina
Gender: Male

Post by numsOic (?) » Mon Mar 26, 2012 4:08 am

I made an improptu tutorial, so I figured I might revive this thread.

If you work in Gimp, you're in luck! This is my procedure to get rid of unnecessary artifacts for GIFs, especially avatars.

First, get all your layers nice and tidy. In this case, I'm working from a pre-existing image, but at some point you'll want to rename the layers for timing (I use this script to rename layers en masse). Remember that you will need to be in RGB mode for this.

Now...

Image
Image
Image
Image
Image
Image
Image
Image
Image
Image

What I do after this is unoptimize the frames before color-reducing the image in its final state, since this usually gets better areas of similar color. I also always run GIFsicle on the final result.
numsOic
Stare Masters
Joined: May 21, 2011
Location: Argentina
Gender: Male

Post by Wayoshi (?) » Mon Mar 26, 2012 4:59 am

*bookmarks* :gotcha:
Image Image Image :milkshake:
Wayoshi
User avatar
She's the best around, nothing can keep a Fluttershy down.
Stare Masters
Joined: Oct 26, 2011
Gender: Male
  • Website

Post by numsOic (?) » Mon Mar 26, 2012 7:44 pm

Addendum

I forgot to mention the following.

1) More often than not, and most especially if you're working with frames from lower quality videos, the Select by Color tool won't catch all the pixels you instinctively know to be redundant and you'll get something like this:

Image

In that case, just lasso away all that shit with the Free Select Tool to get something like this:

Image

Be aware that the artifacts in the area you lassoed will still be there in the next frame, and this is cumulative, unless something appears in the following frame that you don't actually want deleted. If you're savvy enough, you can let some of these artifacts stay there every few frames and this'll clear them for future frames without affecting the final filesize much, though you must choose the ones that are closer to the part you're not deleting; lone artifacts in big blank areas aren't good. This is mostly just a way to save time; ideally you'd remove all the artifacts.

2) If you're working from scratch, on the delete-the-black-area step you might get an image that looks like the "negative" of what it's supposed to:

Image

This just means that the layer does not have transparency and the deleted area became white instead, which you do not want. Either add transparency to every layer (right click on the layer, "Add alpha channel"; or press the menu key and the H key) or, even simpler, just use this script.
numsOic
Stare Masters
Joined: May 21, 2011
Location: Argentina
Gender: Male

Previous Next

Return to One Art, Please!

Who is online

Users browsing this forum: Gnot Syndrome and 1 guest