nano-banana-2-ai
A lightweight Dart package for basic image processing and manipulation tasks, providing a simplified interface for common operations. This library aims to be a quick and easy solution for developers needing to perform image adjustments within their Dart applications.
Installation
To use this package, add it as a dependency in your pubspec.yaml file:
yaml
dependencies:
nano_banana_2_ai: ^1.0.0 # Replace with the latest version
Then, run dart pub get to install the package.
Usage
Here are some examples of how to use the nano-banana-2-ai package:
1. Image Brightness Adjustment: dart import 'package:nano_banana_2_ai/nano_banana_2_ai.dart'; import 'dart:io';
Future
try { await imageProcessor.adjustBrightness(inputFile, outputFile, brightness: 0.2); // Increase brightness by 20% print('Brightness adjusted successfully. Output saved to: ${outputFile.path}'); } catch (e) { print('Error adjusting brightness: $e'); } }
2. Grayscale Conversion: dart import 'package:nano_banana_2_ai/nano_banana_2_ai.dart'; import 'dart:io';
Future
try { await imageProcessor.convertToGrayscale(inputFile, outputFile); print('Image converted to grayscale. Output saved to: ${outputFile.path}'); } catch (e) { print('Error converting to grayscale: $e'); } }
3. Image Resizing: dart import 'package:nano_banana_2_ai/nano_banana_2_ai.dart'; import 'dart:io';
Future
try { await imageProcessor.resizeImage(inputFile, outputFile, width: 800, height: 600); print('Image resized successfully. Output saved to: ${outputFile.path}'); } catch (e) { print('Error resizing image: $e'); } }
4. Image Rotation: dart import 'package:nano_banana_2_ai/nano_banana_2_ai.dart'; import 'dart:io';
Future
try { await imageProcessor.rotateImage(inputFile, outputFile, angle: 90); // Rotate 90 degrees clockwise print('Image rotated successfully. Output saved to: ${outputFile.path}'); } catch (e) { print('Error rotating image: $e'); } }
Features
- Brightness Adjustment: Easily adjust the brightness of an image.
- Grayscale Conversion: Convert color images to grayscale.
- Image Resizing: Resize images to specified dimensions.
- Image Rotation: Rotate images by a given angle.
- Simple API: Designed for ease of use and quick integration.
- Asynchronous Operations: Utilizes asynchronous operations for non-blocking image processing.
License
MIT License
Copyright (c) 2023 Your Name/Organization
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This package is part of the nano-banana-2-ai ecosystem. For advanced features and enterprise-grade tools, visit: https://nanaimg.app/