{"id":1437,"url":"https://github.com/wangjwchn/AImage","last_synced_at":"2025-08-02T04:31:06.746Z","repository":{"id":56900501,"uuid":"52365455","full_name":"wangjwchn/AImage","owner":"wangjwchn","description":"An animated gif \u0026 apng engine for iOS in Swift. Have a great performance on memory and cpu usage.","archived":false,"fork":false,"pushed_at":"2018-05-18T09:04:54.000Z","size":5947,"stargazers_count":986,"open_issues_count":10,"forks_count":91,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-07-05T03:26:25.759Z","etag":null,"topics":["animation","apng","gif","image","swift","swift4"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wangjwchn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-23T14:38:31.000Z","updated_at":"2025-06-30T20:30:55.000Z","dependencies_parsed_at":"2022-08-21T02:50:49.301Z","dependency_job_id":null,"html_url":"https://github.com/wangjwchn/AImage","commit_stats":null,"previous_names":["wangjwchn/jwanimatedimage"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/wangjwchn/AImage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangjwchn%2FAImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangjwchn%2FAImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangjwchn%2FAImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangjwchn%2FAImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wangjwchn","download_url":"https://codeload.github.com/wangjwchn/AImage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangjwchn%2FAImage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334610,"owners_count":24233793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","apng","gif","image","swift","swift4"],"created_at":"2024-01-05T20:15:46.451Z","updated_at":"2025-08-02T04:31:06.470Z","avatar_url":"https://github.com/wangjwchn.png","language":"Swift","funding_links":[],"categories":["Media"],"sub_categories":["GIF","Other free courses"],"readme":"![Cover](https://wangjwchn.github.io/image/cover.png)\n\n[![Language](https://img.shields.io/badge/swift-4.0-orange.svg)](http://swift.org)\n[![Pod License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/wangjwchn/AImage/master/LICENSE)\n\n\n## Features\n\n- [x] Small but complete, only`200`lines of code. \n- [x] Allow to control display quality, memory usage, loop time and display progress.\n- [x] Have a great performance on memory and cpu usage. \n- [x] Using asynchronous image decoding to reduce the main thread CPU usage.\n\n\n## Usage\n\n```swift\n/* Create AImage with URL */\nlet image = AImage(url: Bundle.main.url(forResource: \"test\", withExtension: \"gif\")!)\n\n/* Create AImageView */\nlet imageview = AImageView(frame:CGRect(x: 0.0, y: 50.0, width: 380.0, height: 212.0))\n\n/* Add AImage to AImageView */\nimageview.add(image: image!)\n\n/* Start displaying animated image */\nimageview.play = true\n\n...\n...\n\n/* Stop displaying animated image */\nimageview.play = false\n\n```\n\n## Benchmark\n\nCompared with [Gifu](https://github.com/kaishin/Gifu/tree/swift4) and [Apple's example code](https://developer.apple.com/library/content/samplecode/UsingPhotosFramework/Introduction/Intro.html).\n\n#### Test1: Display [view.gif](https://wangjwchn.github.io/image/view.gif)\n\n|Library|CPU|Memory|\n|:--:|:--:|:--:|\n|Apple's Example Code |  \u003cimg src=\"https://wangjwchn.github.io/image/apple-view-cpu.png\" width = \"1000\" height = \"150\" /\u003e   |    \u003cimg src=\"https://wangjwchn.github.io/image/apple-view-mem.png\" width = \"600\" height = \"120\" /\u003e     |\n|Gifu| \u003cimg src=\"https://wangjwchn.github.io/image/gifu-view-cpu.png\" width = \"1000\" height = \"150\" /\u003e   |    \u003cimg src=\"https://wangjwchn.github.io/image/gifu-view-mem.png\" width = \"600\" height = \"120\" /\u003e     |\n|AImage|  \u003cimg src=\"https://wangjwchn.github.io/image/aimage-view-cpu.png\" width = \"1000\" height = \"150\" /\u003e   |    \u003cimg src=\"https://wangjwchn.github.io/image/aimage-view-mem.png\" width = \"600\" height = \"120\" /\u003e     |\n\n#### Test2: Display [earth.gif](https://wangjwchn.github.io/image/earth.gif)\n\n|Library|CPU|Memory|\n|:--:|:--:|:--:|\n|Apple's Example Code |  \u003cimg src=\"https://wangjwchn.github.io/image/apple-earch-cpu.png\" width = \"1000\" height = \"150\" /\u003e   |    \u003cimg src=\"https://wangjwchn.github.io/image/apple-earth-mem.png\" width = \"600\" height = \"120\" /\u003e     |\n|Gifu| \u003cimg src=\"https://wangjwchn.github.io/image/gifu-earth-cpu.png\" width = \"1000\" height = \"150\" /\u003e   |    \u003cimg src=\"https://wangjwchn.github.io/image/gifu-earth-mem.png\" width = \"600\" height = \"120\" /\u003e     |\n|AImage|  \u003cimg src=\"https://wangjwchn.github.io/image/aimage-earth-cpu.png\" width = \"1000\" height = \"150\" /\u003e   |    \u003cimg src=\"https://wangjwchn.github.io/image/aimage-earth-mem.png\" width = \"600\" height = \"120\" /\u003e     |\n\nMeasurement Factors:\n\n - Measurement time: August 24, 2017\n\n - Measurement device: iPhone6, iOS 11.0(15A5362a)\n\n## Principles\n- [Here](https://wangjwchn.github.io/blog/Display-animated-image-on-iOS-device)\n \n## Old Version\n\nVersion of swift 2.3 can be found in [here](https://github.com/wangjwchn/AImage/tree/Swift2.3).\n \n## Licence\nAImage is released under the MIT license. See [LICENSE](https://github.com/wangjwchn/JWAnimatedImage/raw/master/LICENSE) for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangjwchn%2FAImage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangjwchn%2FAImage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangjwchn%2FAImage/lists"}