@Parallax Skull
OK so how I did the masking for my edit to your gif is pretty straightforward. I stumbled upon this just messing around last weekend and I don't know how much of this stuff is common knowledge, so if I'm saying a bunch of obvious stuff, well,
I used photoshop CS6, so the UI might be a bit different from your version, but I guarantee the tools are still there so you should be able to do this yourself without having to jump through any weird extra hoops.
The main tool I used to block out regions was the thresholding tool. You go to a layer, layer 15 in this example, click the button, and it generates a new layer that looks like this:
The pixels in the new layer are set to black or white depending on whether the corresponding pixels in the layer 15 fall below or above a certain threshold level that you can dynamically change with that slider. The default dimension of comparison against the threshold value is each pixel's grayscale intensity, but you can also threshold against a single color channel, or two out of the three color channels. I didn't get a screenshot of that menu but iirc you get to that selection by clicking on a tab that's obscured by the yellow tooltip above.
128 is the default threshold value. Lower it and you get more white:
Raise it and you get more black:
Since the threshold layer is binary, there are going to be large contiguous regions selectable with one click of the magic wand. The goal is to set the threshold so that you can select the region you want in as few clicks as possible. Luckily, animation tends to have foreground objects defined by sharp borders, typically in the form of actual black outlines, which helps us out a lot. In this image all the colors are pretty smooth and the way the characters enter and exit the frame makes it so that the rightmost part of their collective outlines forms a continuous foreground/background delimiter. For most frames I was able to set the threshold value such that I could select the entire sky region in a single click, then use that mask to delete those pixels in both the original frame and the duplicate frame in the second half of the gif.
Some frames are a bit more involved. For example, on frame 15 I couldn't get the threshold to work that well; here it is at 118.
The entire sky is white and the character outlines form a dividing line, but they're too thin, and the magic wand selection passes through them to select almost the whole image (all the selection work was done on the threshold layer; I switched the view back to the original frame here to make the selection boundary easier to see):
When that happens just set the threshold higher and clean up the noise with quick select and lasso.
For this frame the quick select took care of the pixels along the bottom of the moon, but kept eating the black border around gohan's hair spike, so I used the lasso there.
(The final gif has 2 frames with that exact mistake because I wasn't really paying close attention and didn't notice until after I'd exported and closed out of photoshop.)
You can leave in some sky pixels near the border and be fine, but if the border is missing in a bunch of frames it's pretty jarring.
This is the end product for that frame, and the corresponding duplicate in the second half of the gif:
At the end I went through and set layer 1 to be visible during every frame, and ta da, static background for the whole animation.
Some notes:
The starting point for my edit was your gif, so I was already working within a restricted color palette; if you're working from an imported mp4 with a wider range of colors you may have to fiddle with it more than I did to get the regions you want. Also, where this is useful is going to be very situational; obviously the gif I used is pretty ideal. In your gif where cell is thrashing away at android 17 with his tail you'd only be able to use it on the non-tail parts of cell in the first half of the gif. Your Dragon Ball Super gifs with all the cgi auras and camera shaking will be considerably tougher to use this on, and it might not be worth the effort, but doing it in certain spots might also save enough space to let you keep more of the color palette, so you're just going to have to play around with it to be sure.
Another note: thresholding against a single color channel as opposed to grayscale may or may not be that useful; pixels defined by RGB tuples can be deceptive in that, just because a region looks more blue to the eye than its surroundings doesn't necessarily mean that the pixels in that region have a significantly different value in their blue color channel than ones in neighboring regions. For example, here is frame 15 with the red and green channels zeroed out:
The sky isn't much different from the characters, really. You just have to get a feel for how and when to use those options I guess.