News for hackers. Stuff that matters.
Re:Lossy GIF compressor by innagadadavida on Tuesday March 13, 2018 @02:29AM (#16574186)
Gif needs to be EOLd - there is no need to use it as most browsers support modern alternatives like mp4 with real video codecs. Even safari tech preview can now play these inlined.
Re:Lossy GIF compressor by vardump on Tuesday March 13, 2018 @06:37AM (#16575023)
mp4? That's not a video compression format. It's a stream container format. mp4 files might contain RealVideo (ugh) or MPEG1... or pretty much anything really.

Perhaps you meant h.264 or MPEG-4 (which should not be confused with mp4 container format!).

You can decode GIFs with a few hundred lines of code. Decoding different mp4 cases requires several orders of magnitude more code.

One big advantage of GIFs is simplicity. So perhaps you could come up with something that could be decoded with at most one or two orders of magnitude more code?

Re:Lossy GIF compressor by emerged on Tuesday March 13, 2018 @04:02AM (#16574457)
Do you suggest that the untold billions of both animated and static GIFs should be lossily transcoded to mp4 (which presumably also has a limited shelf life?) so that we can finally remove GIF support from web browsers because [reason here]?

Btw, mp4 is a container format.

Re:Lossy GIF compressor by yoz-y on Tuesday March 13, 2018 @04:43AM (#16574589)
There is also APNG, which might be better suited for this and supports transparency.
Re:Lossy GIF compressor by opencl on Tuesday March 13, 2018 @08:36AM (#16575602)
APNG is a strictly superior drop in replacement for GIF, has been around for ages, but never got adopted by anyone but firefox. I don't get it. Animated WebP also fills the same role but lacks support outside of Chrome.

The trend of converting gifs to h264 videos is kind of awful in terms of image quality but I'm sure it saves a lot of bandwidth for sites like imgur and twitter.

Re:Lossy GIF compressor by yoz-y on Tuesday March 13, 2018 @08:43AM (#16575631)
APNG works in both Chrome and Safari, haven't tested in IE/Edge.

h264 might have an advantage since it does consume less cpu due to hardware support though.

Re:Lossy GIF compressor by opencl on Tuesday March 13, 2018 @10:28AM (#16576350)
You're right, looks like Chrome added it last year, only 9 years after Firefox. h264 is efficient to decode but it's always lossy and gif->h264 conversions have the worst of both worlds qualities of h264 video compression artifacts and being limited to a 256 color palette.
Re:Lossy GIF compressor by innagadadavida on Tuesday March 13, 2018 @10:54AM (#16576584)
most normal people consuming the content don’t care about it being lossy as PSNR good. That’s the reason why Giphy and others provide an mp4/264 alternate format. Reddit also seems to be embedding mp4/264 instead of gifs.
Re:Lossy GIF compressor by xd1936 on Tuesday March 13, 2018 @09:17AM (#16575836)
aPNG was never accepted by the PNG standards body, and tends to be as large or larger than GIF[1]. If we're going to go through the effort of converting, then WebP makes way more sense.

1. https://www.androidpolice.com/2017/05/01/animated-png-format...

Re:Lossy GIF compressor by yoz-y on Tuesday March 13, 2018 @10:35AM (#16576423)
It seems to me that WebP is more of a replacement for "animated" JPEG than PNG. http://littlesvr.ca/apng/gif_apng_webp5.html in these comparisons apng has the edge. Ideally we could have both. Sadly Apple is not willing to add webp/webm support to safari.
Re:Lossy GIF compressor by maxst on Tuesday March 13, 2018 @09:57AM (#16576095)
If you convert static GIF to static PNG, 99% of the time you'll get a smaller file. That was the original goal of PNG project, and it succeeded: static GIFs disappeared completely. Converting animated GIF to animated PNG leads to similar filesize savings.
Re:Lossy GIF compressor by innagadadavida on Tuesday March 13, 2018 @10:33AM (#16576406)
Video formats like webp exploit temporal and spatial similarities to get efficiency. Gif/apng do not. This reduces bandwidth costs and file sizes very much.
Re:Lossy GIF compressor by maxst on Wednesday March 14, 2018 @01:11AM (#16582503)
Download a dozen random GIF cinemagraphs, and try gif2webp and gif2apng on them.
Re:Lossy GIF compressor by innagadadavida on Wednesday March 14, 2018 @02:00AM (#16582689)
Try ffmpeg or vlc instead, you will get much better results. Ffmpeg has support for almost all video/audio formats ever invented.
Re:Lossy GIF compressor by nasredin on Tuesday March 13, 2018 @11:15AM (#16576770)
I can not believe nobody mentioned:

APNG is (can be?) lossless. You have to lose a lot of quality in GIF to get reasonable filesizes. APNG gets you lossless quality with decent sizes.

Quality sticklers rejoice!

Re:Lossy GIF compressor by pornel on Tuesday March 13, 2018 @05:33PM (#16580025)
APNG's palette mode is much worse than GIF, and RGBA mode has 3-4 times more data to compress. Deflate is better than LZW, but not that much better, so APNG can only offer either worse quality or worse file size.

Lots of large GIFs used today were converted from H.264 (YouTube, etc.), so the crap quality of H.264 -> GIF -> H.264 is entirely the fault of GIF.

Re:Lossy GIF compressor by maxst on Wednesday March 14, 2018 @01:30AM (#16582576)
> APNG's palette mode is much worse than GIF

In terms of image quality, it's only slightly worse. But having the same palette for all frames helps to make inter-frame optimization much more efficient.

Re:Lossy GIF compressor by innagadadavida on Tuesday March 13, 2018 @10:27AM (#16576339)
Post is talking about lossy gif->gif conversion. MP4/H264 do the same but get you 10x gains, while maintaining much better quality. One tradeoff is the loss of transparency.

Yes, I assumed everyone here knows about mp4/h264/etc. Nokia also released a more formal container spec using HEIF, that supports transparency (most folks will complain about patent encumbered issues). However it will be a while before browsers support it.

Re:Lossy GIF compressor by rakoo on Tuesday March 13, 2018 @05:41AM (#16574781)
Browsers get the latest development, but you have to remember that the purpose of GIFs is to be shared, sometimes in applications that are not browsers. They still need to be viewable as intended on those platforms.

Personally as soon as I find a mp4 instead of a gif I curse the uploader for not providing a reasonable gif backup I can use and share around.

Re:Lossy GIF compressor by dspillett on Tuesday March 13, 2018 @03:18AM (#16574337)
> tech preview

As it is not yet generally available as something the public will install, and given how long it can take for a wide userbase to upgrade, this support wouldn't mean being able to set gif's EoL to any date soon.

Unless you refuse to let Safari hold you back as IE6 did for so long (and to an extent newer IE versions still do depending on you target audience - in my day job I have no choice but to support IE 8 and 11 to this day). Though if that is the case then you've stopped actively supporting Safari already.

Re:Lossy GIF compressor by innagadadavida on Tuesday March 13, 2018 @10:35AM (#16576432)
Will be out in 6 months. Chrome already supports it.
Re:Lossy GIF compressor by spbaar on Tuesday March 13, 2018 @11:52AM (#16577114)
Consider mobile. A huge number of phones, ones you might consider mid tier and not low end, can only play 1 or 2 videos at a time. Hence, the need for a video format that can be rendered in only software.
Re:Lossy GIF compressor by Aelius on Tuesday March 13, 2018 @12:15PM (#16577279)
Except h.264 videos have hw accel behind them (faster + less power draw) and use less data, making them doubly preferable on mobile as well.
Re:Lossy GIF compressor by jlebrech on Tuesday March 13, 2018 @05:55AM (#16574838)
Browsers need to be EOLd in favour of sandbox binary app launchers but that's not gonna happen any time soon.
Re:Lossy GIF compressor by antoineMoPa on Tuesday March 13, 2018 @10:33AM (#16576407)
With all the gif art that gets created, I would be really sad about this.
Re:Lossy GIF compressor by tomcooks on Tuesday March 13, 2018 @03:15AM (#16574328)
B-but my millenial retro posers