{"action":"created","issue":{"url":"https://api.github.com/repos/opentoonz/opentoonz/issues/769","repository_url":"https://api.github.com/repos/opentoonz/opentoonz","labels_url":"https://api.github.com/repos/opentoonz/opentoonz/issues/769/labels{/name}","comments_url":"https://api.github.com/repos/opentoonz/opentoonz/issues/769/comments","events_url":"https://api.github.com/repos/opentoonz/opentoonz/issues/769/events","html_url":"https://github.com/opentoonz/opentoonz/pull/769","id":173629414,"number":769,"title":"Gif Trimming and Transparency","user":{"login":"turtletooth","id":4576381,"avatar_url":"https://avatars3.githubusercontent.com/u/4576381?v=4","gravatar_id":"","url":"https://api.github.com/users/turtletooth","html_url":"https://github.com/turtletooth","followers_url":"https://api.github.com/users/turtletooth/followers","following_url":"https://api.github.com/users/turtletooth/following{/other_user}","gists_url":"https://api.github.com/users/turtletooth/gists{/gist_id}","starred_url":"https://api.github.com/users/turtletooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turtletooth/subscriptions","organizations_url":"https://api.github.com/users/turtletooth/orgs","repos_url":"https://api.github.com/users/turtletooth/repos","events_url":"https://api.github.com/users/turtletooth/events{/privacy}","received_events_url":"https://api.github.com/users/turtletooth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-28T04:56:22Z","updated_at":"2017-09-25T03:49:39Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/opentoonz/opentoonz/pulls/769","html_url":"https://github.com/opentoonz/opentoonz/pull/769","diff_url":"https://github.com/opentoonz/opentoonz/pull/769.diff","patch_url":"https://github.com/opentoonz/opentoonz/pull/769.patch"},"body":"This enables trimming of transparent areas on gif images and exporting with transparency.\nThe exporting with transparency uses ImageMagick which needs to be configured in preferences the same way ffmpeg is. \n\n![preferencesgif](https://cloud.githubusercontent.com/assets/4576381/18031664/468bd438-6ca9-11e6-8bb5-7771987be161.jpg)\n\nI also added the ability to add extra padding to trimmed images in case someone didn't want the exported image at the very edge of the screen.\n\n![gifsettings](https://cloud.githubusercontent.com/assets/4576381/18031663/42c3e46c-6ca9-11e6-8bd1-ab935504965b.jpg)\n\nFor images that have a lot of semi-transparency, I added a image dithering option.  This is not desirable for most images, but makes a difference sometimes- see below.\n\nNon-transparent gif:\n![trimmed-non-transparent](https://cloud.githubusercontent.com/assets/4576381/18031665/507b35f6-6ca9-11e6-8e88-be21f6d47064.gif)\n\nTransparent gif:\n![trimmed-transparent](https://cloud.githubusercontent.com/assets/4576381/18031667/5bfc68fa-6ca9-11e6-8e6c-e2d75e2c1a65.gif)\n\nTransparent gif with dithering:\n![trimmed-transparent-dithered](https://cloud.githubusercontent.com/assets/4576381/18031668/639416c6-6ca9-11e6-8520-18224053bf3e.gif)\n\nNote that the dithering was only needed because of the semi-transparent area.  I realize that the final image isn't that great, but gif doesn't support semi-transparency.  It is either on or off, so a dithering pattern is the best that ImageMagick seems to offer at the moment.\n"},"comment":{"url":"https://api.github.com/repos/opentoonz/opentoonz/issues/comments/331770707","html_url":"https://github.com/opentoonz/opentoonz/pull/769#issuecomment-331770707","issue_url":"https://api.github.com/repos/opentoonz/opentoonz/issues/769","id":331770707,"user":{"login":"RodneyBaker","id":2576432,"avatar_url":"https://avatars1.githubusercontent.com/u/2576432?v=4","gravatar_id":"","url":"https://api.github.com/users/RodneyBaker","html_url":"https://github.com/RodneyBaker","followers_url":"https://api.github.com/users/RodneyBaker/followers","following_url":"https://api.github.com/users/RodneyBaker/following{/other_user}","gists_url":"https://api.github.com/users/RodneyBaker/gists{/gist_id}","starred_url":"https://api.github.com/users/RodneyBaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RodneyBaker/subscriptions","organizations_url":"https://api.github.com/users/RodneyBaker/orgs","repos_url":"https://api.github.com/users/RodneyBaker/repos","events_url":"https://api.github.com/users/RodneyBaker/events{/privacy}","received_events_url":"https://api.github.com/users/RodneyBaker/received_events","type":"User","site_admin":false},"created_at":"2017-09-25T03:49:39Z","updated_at":"2017-09-25T03:49:39Z","author_association":"NONE","body":"I ran across this reference and it has me wondering if rgb24 (versus pal8) format might be related to the issue with gif transparency via ffmpeg...\r\n\r\nhttps://trac.ffmpeg.org/ticket/715\r\n\r\nThe pertinent part:\r\n> This works now for ffmpeg -i 11.png -f image2 out.gif\r\n> There are two gif encoders, only one supports pal8 output, the other only supports **RGB24** which **by definition does not support transparency**.\r\n> \r\n\r\nPerhaps this won't make any difference but including it here just in case.\r\nAssuming the use of pal8 encoder gains transparency it might negate any benefits due to loss of RGB24. \r\n\r\nAt any rate, it would appear that if ffmpeg uses the RGB24 encoder then transparency will not be an option but it might be if using the pal8 encoder.  The issue with using pal8 would likely be that a sorting of color palette might need to be executed first because pal8 only supports 256 colors and therefore some optimization would be required in order to gain the best possible image with the limited palette. "}}
{"actor":{"display_login":"RodneyBaker"}}