{"id":13395729,"url":"https://github.com/brendan-duncan/image","last_synced_at":"2025-05-13T19:02:53.470Z","repository":{"id":13094851,"uuid":"15776193","full_name":"brendan-duncan/image","owner":"brendan-duncan","description":"Dart Image Library for opening, manipulating, and saving various different image file formats.","archived":false,"fork":false,"pushed_at":"2025-05-12T16:48:21.000Z","size":94609,"stargazers_count":1213,"open_issues_count":143,"forks_count":280,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-05-12T17:57:34.294Z","etag":null,"topics":["dart","dart-library","dart-package","dart-web","dartlang","flutter","image","image-processing","jpeg","png","webp"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brendan-duncan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"brendan-duncan"}},"created_at":"2014-01-09T19:03:48.000Z","updated_at":"2025-05-12T16:48:25.000Z","dependencies_parsed_at":"2024-03-22T19:26:52.682Z","dependency_job_id":"ad5dd058-a67c-41d4-9b99-707f547e358a","html_url":"https://github.com/brendan-duncan/image","commit_stats":{"total_commits":1016,"total_committers":94,"mean_commits":"10.808510638297872","dds":0.2696850393700787,"last_synced_commit":"22313321923802e16b8009719abf27ccff5c9357"},"previous_names":[],"tags_count":90,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendan-duncan%2Fimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendan-duncan%2Fimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendan-duncan%2Fimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendan-duncan%2Fimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brendan-duncan","download_url":"https://codeload.github.com/brendan-duncan/image/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254010792,"owners_count":21998993,"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","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":["dart","dart-library","dart-package","dart-web","dartlang","flutter","image","image-processing","jpeg","png","webp"],"created_at":"2024-07-30T18:00:29.527Z","updated_at":"2025-05-13T19:02:53.438Z","avatar_url":"https://github.com/brendan-duncan.png","language":"Dart","funding_links":["https://github.com/sponsors/brendan-duncan"],"categories":["Image","图像","Dart","Libraries"],"sub_categories":["Dart","Image"],"readme":"# Dart Image Library\n[![Dart CI](https://github.com/brendan-duncan/image/actions/workflows/build.yaml/badge.svg?branch=4.0)](https://github.com/brendan-duncan/image/actions/workflows/build.yaml)\n[![pub package](https://img.shields.io/pub/v/image.svg)](https://pub.dev/packages/image)\n\n## Overview\n\nThe Dart Image Library provides the ability to load, save, and\n[manipulate](https://github.com/brendan-duncan/image/blob/main/doc/filters.md) images\nin a variety of image file [formats](https://github.com/brendan-duncan/image/blob/main/doc/formats.md).\n\nThe library can be used with both dart:io and dart:html, for command-line, Flutter, and\nweb applications.\n\nNOTE: 4.0 is a major revision from the previous version of the library.\n\n## [Documentation](https://github.com/brendan-duncan/image/blob/main/doc/README.md)\n\n### [Supported Image Formats](https://github.com/brendan-duncan/image/blob/main/doc/formats.md)\n\n**Read/Write**\n\n- JPG\n- PNG / Animated APNG\n- GIF / Animated GIF\n- BMP\n- TIFF\n- TGA\n- PVR\n- ICO\n\n**Read Only**\n\n- WebP / Animated WebP\n- PSD\n- EXR\n- PNM (PBM, PGM, PPM)\n\n**Write Only**\n\n- CUR\n\n## Examples\n\nCreate an image, set pixel values, save it to a PNG.\n```dart\nimport 'dart:io';\nimport 'package:image/image.dart' as img;\nvoid main() async {\n  // Create a 256x256 8-bit (default) rgb (default) image.\n  final image = img.Image(width: 256, height: 256);\n  // Iterate over its pixels\n  for (var pixel in image) {\n    // Set the pixels red value to its x position value, creating a gradient.\n    pixel..r = pixel.x\n    // Set the pixels green value to its y position value.\n    ..g = pixel.y;\n  }\n  // Encode the resulting image to the PNG image format.\n  final png = img.encodePng(image);\n  // Write the PNG formatted data to a file.\n  await File('image.png').writeAsBytes(png);\n}\n```\n\nTo asynchronously load an image file, resize it, and save it as a thumbnail: \n```dart\nimport 'package:image/image.dart' as img;\n\nvoid main(List\u003cString\u003e args) async {\n  final path = args.isNotEmpty ? args[0] : 'test.png';\n  final cmd = img.Command()\n    // Decode the image file at the given path\n    ..decodeImageFile(path)\n    // Resize the image to a width of 64 pixels and a height that maintains the aspect ratio of the original. \n    ..copyResize(width: 64)\n    // Write the image to a PNG file (determined by the suffix of the file path). \n    ..writeToFile('thumbnail.png');\n  // On platforms that support Isolates, execute the image commands asynchronously on an isolate thread.\n  // Otherwise, the commands will be executed synchronously.\n  await cmd.executeThread();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrendan-duncan%2Fimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrendan-duncan%2Fimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrendan-duncan%2Fimage/lists"}