8 ms·
Lossy GIF compressor
- Arbalest 9y agoI like this part on the end > App Store terms and conditions forbid distribution of Free Software that grants users freedom to use the program any way they want. You're not allowed to distribute this software with DRM applied to it. Basically the essence of the GPL in one short paragraph.
- nemothekid 9y agoIs this actually correct? If I distribute my app on the App Store, and provide a GitHub link in the description of the the full source code of the app, then it should comply with the GPL.
- drew-y 9y agoThat's what I was thinking. Some home routers have source links for the free software they use.
- jacobush 9y agoBut I'd venture a guess that this source code is GPLv2 licensed, not GPLv3 licensed. They could make their firmware GPLv3 compliant, but it would be quite a bit of extra work.
- kevin_thibedeau 9y agoGPL compliance requires that you can reproduce a binary from the source with no additional encumbrances. That's not possible on Apple platforms. It's not enough to just provide the source.
- tomc1985 9y agoAre you referring to additional meta that Apple applies to apps in the app store or something else?
- inyorgroove 9y agoSo no signed binaries? The signature portion will obviously not be reproducible by anyone but the original signer. I believe that is all the App Store process does, sign with a key issued by Apple, but it might be more complex.
- slavik81 9y ago> I use public key cryptography to sign my code to assure its authenticity. Is it true that GPLv3 forces me to release my private signing keys?I use public key cryptography to sign my code to assure its authenticity. Is it true that GPLv3 forces me to release my private signing keys? > No. The only time you would be required to release signing keys is if you conveyed GPLed software inside a User Product, and its hardware checked the software for a valid cryptographic signature before it would function. In that specific case, you would be required to provide anyone who owned the device, on demand, with the key to sign and install modified software on the device so that it will run. If each instance of the device uses a different key, then you need only give each purchaser a key for that instance. https://www.gnu.org/licenses/gpl-faq.en.html#GiveUpKeys https://www.gnu.org/licenses/gpl-faq.en.html#GiveUpKeys
- jacobush 9y agoAnd in the case of a Mac, so far you don't need keys to install software you compiled yourself. On iOS there are additional encumbrances, like the need for a dev account, a separate computing device (a Mac) to compile for the iOS device, and so on.
- nothrabannosir 9y agoIt’s getting harder and harder for kexts. You can’t readily compile those from source and install them yourself without a developer license , anymore. You currently technically still can, I believe (restart in some safe mode and disable a protection mechanism of sorts, iirc), but the trend is not towards openness. Honestly I don’t doubt for a second they’re doing it purely for the sake of security, but that doesn’t really matter for the GPL as far as I’m aware ?
- jacobush 9y agoI'd say that it's possible on a Mac, but not on an iOS device. You can't develop iOS apps on an iOS device, for starters. Just that is an additional encumbrance. Last time I checked, you also need some dev account with Apple to upload apps to your iOS device. (Remember, these rules are subject to interpretation, in court in the extreme case.)
- zbowling 9y agoIf you own all the copyrights to the source of the app you are linking on Github, then you can release it on the Appstore effectively under a different license for that version. If you don't own all the code, then are possibly violating someone else's license.
- chungy 9y agoShort answers: GPLv2, no; GPLv3, yes. Apple's App Store is identical to the TiVoization problem that GPLv3 was written to combat: https://www.gnu.org/licenses/rms-why-gplv3 https://www.gnu.org/licenses/rms-why-gplv3
- dragonwriter 9y agoTivoization provision of GPLv3 only applies to software distributed as with a hardware “ussr product” (in the same transaction in which possessory interest in the hardware is transferred), so while it would apply to core components of iOS (of they used GPLv3 upstream, which they won't), it wouldn't seem to apply to any third party software distributed through the App Store. (The same concerns that motivated anti-tivoization may apply, but the actual license terms don't appear to.) This is not to say that there aren't other incompatibilities, but anti-tivoization doesn't seem to be a problem.
- chungy 9y agoThere is no difference. Apple provides binaries (via the App Store), and the user is not allowed to install/run their own binaries, which is a requirement the GPLv3 added to prevent TiVoization. It matters not whether the software is preinstalled or offered on the side, the effect is the same. If the user can't install their own versions of software, the environment is incompatible with the GPLv3. Now, running GPLv3 software via Cydia/jailbroken-iPhones is probably OK, since the user has gone through the effort in order to run their own versions of software. I'm pretty sure the FSF would prefer running a free software version of Android instead, however. :-)
- deleted 9y ago[deleted]
- jcelerier 9y ago> There is no difference. Apple provides binaries (via the App Store), and the user is not allowed to install/run their own binaries, which is a requirement the GPLv3 added to prevent TiVoization. This has not been true for a few years. Nowadays anyone can freely upload apps from Xcode to iDevices (before it used to cost 99$)
- rmc 9y agoThe Free Software Foundation has some details on this[1]. This used to come up with the video player VLC, but they seem to have relicenced it, and it's now possible.[2] I've heard one reason is that the App Store requires users to agree to additional usage restrictions, which the GPL forbids distributors (in this case Apple) from applying. [1] https://www.fsf.org/blogs/licensing/more-about-the-app-store-gpl-enforcement https://www.fsf.org/blogs/licensing/more-about-the-app-store... [2] https://www.videolan.org/vlc/download-ios.html https://www.videolan.org/vlc/download-ios.html
- abritinthebay 9y agoIt's correct that GPLv3 forbids it (I think v2 doesn't) which isn't a problem with the App Store - it's a problem with the (opinionated) GPLv3. Plenty of other OSS licenses work fine on the app store.
- pornel 9y agoIt's irrelevant what you do to comply. To distribute in the App Store, Apple requires you to sign an agreement in which you license the code to Apple under Apple's non-FOSS terms. If you don't have the right to license the code under Apple's terms, Apple won't take it. Apple doesn't comply with GPL and they don't want to. On a few occasions I have formally asked them to comply with GPL terms and they took GPLed apps down instead.
- mythz 9y agoIt sounds like he wants to make it illegal on the AppStore: > Permission is granted to copy, distribute, or alter Gifsicle, whole or in part, as long as source code copyright notices are kept intact, with the following restriction: Developers or distributors who plan to use Gifsicle code, whole or in part, in a product whose source code will not be made available to the end user -- more precisely, in a context which would violate the GPL -- MUST contact the author and obtain permission before doing so. - https://github.com/kornelski/giflossy#copyrightlicense https://github.com/kornelski/giflossy#copyrightlicense
- jacobush 9y agoHe made it illegal when he chose GPL(v3). The text above just points it out. That it's inconvenient for app store users has no bearing on legality. Of course, as the author, he could with a stroke of the hand give an app store excemption or change/add a license, but clearly, he doesn't want to.
- boomlinde 9y agoThe software is based on Gifsicle, itself a GPLv2 licensed piece of software, so there isn't much the author could legally do about it. This comment section is filled with weird misconceptions about the software and about the compatibility between GPL and the Apple store terms of service. Somehow people think the software is GPLv3 even though a cursory glance will reveal that it isn't. People think that the author of the modification has a say in how it's licensed. It's based on GPLv2 software, he doesn't. Others are saying that while distributing GPLv2 licensed software on the Apple store is fine, GPLv3 isn't, when neither is OK. Sorry for soapboxing here, but it seems appropriate to address all these misconceptions in one place.
- aw3c2 9y agoAnd that's awesome and a boon to society!
- yoz-y 9y agoWhy not use the AGPL in this case though? GPLv3 still does not prevent you from putting it on a server and exposing it as a SAAS.
- boomlinde 9y agoWhat makes you assume that's something he wants to prevent?
- yoz-y 9y agoThe tone. I assume that if the author does not want people to distribute the library in an application with DRM, regardless of the fact whether they publish the source code or not they would also not be happy if somebody just took it, modified it and sold it as service without publishing their code.
- boomlinde 9y agoLet's maybe generously assume that the author is not dumb and would carefully choose a license based on his needs and preferences. Then consider the facts: The work is based on GPLv2 licensed tool (gifsicle), thus subject to the same terms and conditions. Knowing that, one can read the note as a friendly reminder of how the ToS of the Apple store is incompatible with GPLv2. You may have read it as snark, but it's literally just stating a matter of fact regarding a matter the author of the fork can't legally do anything about.
- deleted 9y ago[deleted]
- donatj 9y agoHuh, I will have to play with this and see how it compares with the naive interframe optimizer I’ve been hacking on for years.
- maturz 9y agoIt's weird that this pull request was never accepted by gifsicle. https://github.com/kohler/gifsicle/pull/16 https://github.com/kohler/gifsicle/pull/16 Also check out his other high-quality GIF encoder project https://gif.ski/ https://gif.ski/ Older HN submission https://news.ycombinator.com/item?id=15730018 https://news.ycombinator.com/item?id=15730018
- citilife 9y agoIt's probably (in part) due to the last line of the article / post: > App Store terms and conditions forbid distribution of Free Software that grants users freedom to use the program any way they want. You're not allowed to distribute this software with DRM applied to it.
- abritinthebay 9y agoWhich is, of course, false. Specific free software licenses have DRM distribution restrictions regardless of if source/non-DRM editions are available. Which of course goes against user freedom too (to have their applications the way they want). That to me says that it's the licence that is the issue (or needs to be improved).
- pornel 9y agogifsicle and the lossy version are both GPL-licensed. That's a deal-breaker for Apple (by their own choosing), but not a problem for the gifsicle project. I think the reason for change not being accepted upstream is that the amount of complexity added exceeds amount of free time the upstream maintainer has.
- innagadadavida 9y agoGif 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.
- tomcooks 9y agoB-but my millenial retro posers
- dspillett 9y ago> 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.
- innagadadavida 9y agoWill be out in 6 months. Chrome already supports it.
- emerged 9y agoDo 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.
- gmaillogin 9y agoI also encounter the same problem. thanks for your answer. https://www.hotmailsigninguide.com https://www.hotmailsigninguide.com
- andrewla 9y agoThe core idea here is really interesting; adapting a lossless compression system in a heuristic approximate mode. Instead of looking backwards for identical subsequences, look for approximate subsequences. Unlike tools like pngquant, which use quantization to create palletized images, this directly hooks into the compression stage. I haven't looked at the source yet, but this is an idea that I've been thinking about recently, especially as regarding the somewhat obscure farbfeld [1] image format, which relies entirely on external compression. Zlib in particular is "easy" to do this for, or at least an approach is clear, in which you can build up a big prefix tree and then "massage" it by combining subtrees. There are a number of different ways that you could approach this heuristically as well. Bzip is a different beast -- the Burrows–Wheeler transform is sensitive to changes in the byte stream, so it's not easy to poke a byte to make it similar to another byte and then get the delta on the transform itself. [1] https://tools.suckless.org/farbfeld/ https://tools.suckless.org/farbfeld/
- guitarbill 9y agoYou can do something similar with ffmpeg’s palettegen/paletteuse or imagemagick’s fuzz option. Generally speaking, fuzz/IM does well for recompressing GIFs, especially high-noise or static background. If you still have the source video, nothing can beat ffmpeg though. (Those options usually require a bit of tweaking though. I can’t compare these at work, might give it a go later.)
- pornel 9y agoThis is absolutely not similar to any ffmpeg/IM's options. This doesn't change the palette, and doesn't rely on static backgrounds. Instead, it integrates very deeply into LZW compression to make dictionary matching visually approximate in a way that maximizes compression. The only other implementation of this that I'm aware of is in Photoshop.
- tambourine_man 9y agoHi Pornel, thanks a lot for the amazing tool. If you are doing the animation from scratch, which would be the preferred workflow for smallest size with as few artifacts as possible? Photoshop Save for Web 256? Which dithering algorithm works best with giflossy? Would exporting every frame as an individual GIF with its own pallet help? Generating an MP4 first then run it through some other quantizer? Thanks
- pornel 9y agoLowering pixel resolution and frame rate will reduce file size the most. Make the gif straight from the original lossless source if possible, since any JPEG-like video compression artifacts will inflate file size in gif. If the input is a video already, use gif.ski And then giflossy. Of course ideally avoid the gif format entirely, since even the best possible compression in it is still horribly awful compared to H.26x and VP9.
- tambourine_man 9y agoThanks, maybe a more specific question: how does it compare to Photoshop’s lossy option in Save for Web? Which dither and color reduction algorithms would be better suited for giflossy?