Is it feasible to convert a short mp4 file to a GIF without negatively impacting the resolution, framerate or resulting in a considerably larger filesize?
I am not hung up on it being a GIF necessarily if there is a better format for accomplishing a similar end result.
+ Reply to Thread
Results 1 to 11 of 11
Another option is Animated WEBP
-lossless, lossy and alpha channel options
-supported by many modern browsers (firefox, chrome, edge, opera, safari added recently)
-8bit per channel color like PNG
*like apng,gif - no temporal compression comparable to video - thus large filesizes compared to typical video
-higher playback overhead (cpu usage) compared to gif or apng
Typical usage scenario might be a lossy scenario, where filesize can be reduced compared to lossless, but retaining more colors and quality than GIF (256 colors) .
Winner: typical mp4, or webm video with temporal compression the real winner. Forget about animated "image" formats.
But if you "needed" an animated "image" format - lossless animated webp in rgb configuration is usually smaller than apng (both larger than gif); and in lossy configuration ~Q96-Q99 , it looks substantially better than "high quality" gifs at much smaller filesizes. But eitherway, expect a considerable increase in filesize over the input video
These days websites are switching to just using H.264 video in a .MP4 container (or VP8 in .WEBM) as a GIF alternative, and just embed it in the HTML.
Example of videos used in place of GIF.
if you are paywalled
Anyway, the filesize is going to grow by 10x or more if you want a 1:1 copy of a video converted to GIF. There are ways to reduce the size of GIF if the GIF is mostly stagnant, allowing frames to just copy information from previous frames. APNG on the other hand does not have this ability (that I know of), instead each frame is Intra and so can't use previous frames to reduce the size. Instead it just uses better Intra compression over GIF's. You aren't going to save much space if any with APNG unless it's an animation.
GIF and PNG (APNG) were never designed around being video like, and so are not good at being video like. GIF was just picked for short clips because everyone already supported GIF the image format which comes with animation ability and so there was no bar to entry.
Last edited by KarMa; 13th Aug 2020 at 23:25.
This is common misconception that GIF can be only 256 colors (GIF can be even 24 bit truecolor) however as for any lossless format, large file sizes should be expected.
There is a lot of formats tailored to replace GIF and some of them can be transparent for modern browser (like https://blog.imgur.com//2014/10/09/introducing-gifv/).
Sometimes changing extension of the file itself, from some common video extension like "MP4" to "GIF" may work just fine...
24 bit GIF? Please link me that specification I've never heard of...
http://aminet.net/package/docs/misc/GIF24 - as rarely picture and video will use al colors from 24 bit RGB color space then it may be alternative to other 24 bit formats (picture can be smaller than 24 bit bitmap).
Picture from https://en.wikipedia.org/wiki/GIF#True_color
Last edited by pandy; 14th Aug 2020 at 08:10.
That tiled gif is a neat workaround. But animated webp is modern, works in modern browsers. The main issues are legacy browser support, and higher decoding requirements
original tiled gif from wikipedia
53.0 KB (54,310 bytes)
[Attachment 54539 - Click to enlarge]
lossless animated webp version
22.7 KB (23,332 bytes)
[Attachment 54540 - Click to enlarge]
Last edited by poisondeathray; 14th Aug 2020 at 10:43.
Some test observations for a AVC/MP4 source
(I won't embed them or upload as image to be kind , but attach in a zip)
source MP4 390KB
gif, ffmpeg default paletteuse 7.14MB
gif, gifski 7.46MB
webp anim lossless RGB 6.88MB
webp anim YUV Q98 1.94MB
The "winner" is always video; even if you re-encoded source mp4 , it would still have smaller filesize.
Animated webp in YUV lossy configuration ~Q96-99 will produce higher quality than gif, yet smaller filesizes ; and for RGB lossless it will usually produce smaller filesizes than APNG
@pandy, your semantic nitpicking and theoretical exceptions through multi-tile trickery notwithstanding, the GIF 87 and GIF 89a spec define the max # of colors in the colortable of each image as 256.
It's a very good idea to use optimized palettes to improve the color impression of this limited format, but that in itself is advanced enough for most users. Sleights of hand with tiling might provide the equivalent of truecolor, but isn't guaranteed to work properly in all browser presentations, much less other vehicles.
Probably best not to get peoples' hopes up with snake oil - much better to suggest newer & better formats.