All Projects → fluttercandies → Flutter_image_editor

fluttercandies / Flutter_image_editor

Licence: mit
Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Flutter image editor

Tkimageview
An easy way to crop an image.
Stars: ✭ 342 (+88.95%)
Mutual labels:  image, crop, editor
Flutter crop
Crop any widget/image in Android, iOS, Web and Desktop with fancy and customizable UI, in pure Dart code.
Stars: ✭ 107 (-40.88%)
Mutual labels:  image, crop, editor
Extended image
A powerful official extension library of image, which support placeholder(loading)/ failed state, cache network, zoom pan image, photo view, slide out page, editor(crop,rotate,flip), paint custom etc.
Stars: ✭ 1,021 (+464.09%)
Mutual labels:  image, crop, rotate
Imaging
Imaging is a simple image processing package for Go
Stars: ✭ 4,023 (+2122.65%)
Mutual labels:  image, crop, rotate
Rskimagecropper
An image cropper / photo cropper for iOS like in the Contacts app with support for landscape orientation.
Stars: ✭ 2,371 (+1209.94%)
Mutual labels:  image, crop, editor
Jqueryrotate
jQueryRotate - plugin to rotate images by any angle cross-browse with animation support
Stars: ✭ 157 (-13.26%)
Mutual labels:  plugin, image, rotate
Docker Nginx Image Proxy
on the fly image cropping with gravity, resize and compression microservice
Stars: ✭ 79 (-56.35%)
Mutual labels:  image, crop
Parrot
A package to rotate text and party with parrots at the same time
Stars: ✭ 99 (-45.3%)
Mutual labels:  plugin, rotate
Bimg
Go package for fast high-level image processing powered by libvips C library
Stars: ✭ 1,394 (+670.17%)
Mutual labels:  image, crop
Vim Kubernetes
vim-kubernetes
Stars: ✭ 112 (-38.12%)
Mutual labels:  plugin, editor
Next Optimized Images
🌅 next-optimized-images automatically optimizes images used in next.js projects (jpeg, png, svg, webp and gif).
Stars: ✭ 1,870 (+933.15%)
Mutual labels:  plugin, image
Uppload
📁 JavaScript image uploader and editor, no backend required
Stars: ✭ 1,673 (+824.31%)
Mutual labels:  plugin, image
Summernote Image Attributes
Summernote plugin to edit image attributes
Stars: ✭ 78 (-56.91%)
Mutual labels:  plugin, image
Nova Advanced Image Field
🌄📐 A Laravel Nova advanced image field with cropping and resizing using Cropper.js and Intervention Image
Stars: ✭ 67 (-62.98%)
Mutual labels:  image, crop
Lipo
👄 Free image manipulation API service built on top of Sharp (an alternative to Jimp, Graphics Magic, Image Magick, and PhantomJS)
Stars: ✭ 101 (-44.2%)
Mutual labels:  image, crop
Scxcodeeditorinset
Xcode plugin that adds an empty (configurable) space to the end of the editor text view
Stars: ✭ 64 (-64.64%)
Mutual labels:  plugin, editor
Mergi
go library for image programming (merge, crop, resize, watermark, animate, ease, transit)
Stars: ✭ 127 (-29.83%)
Mutual labels:  image, crop
Ucrop
Image Cropping Library for Android
Stars: ✭ 11,003 (+5979.01%)
Mutual labels:  image, crop
React Avatar Editor
Small avatar & profile picture component. Resize and crop uploaded images using a intuitive user interface.
Stars: ✭ 1,846 (+919.89%)
Mutual labels:  image, crop
Header
Header Tool for Editor.js 2.0
Stars: ✭ 39 (-78.45%)
Mutual labels:  plugin, editor

image_editor

BUILD

The version of readme pub and github may be inconsistent, please refer to github.

Use native(objc,kotlin) code to handle image data, it is easy to process pictures, and can be used for saving/uploading/preview images.

Screenshot

img

Platform of support

Android, iOS.

Change Log

This version is a null-safety version.

Please read document for null-safety information in dart or flutter.

Support

  • [x] flip
  • [x] crop
  • [x] rotate
  • [x] scale
  • [x] matrix
  • [x] add text
  • [x] mix image
  • [x] merge multi image
  • [x] draw somethings
    • [x] draw point
    • [x] draw line
    • [x] draw rect
    • [x] draw circle
    • [x] draw path
    • [x] draw Bezier
  • [ ] Gaussian blur

ImageEditor Usage

pub package GitHub GitHub stars

dependencies:
  image_editor: $latest

About version, please find it from pub.

Import

import 'package:image_editor/image_editor.dart';

Method list:

ImageEditor.editImage();
ImageEditor.editFileImage();
ImageEditor.editFileImageAndGetFile();
ImageEditor.editImageAndGetFile();

Example used alone

Example of extended_image

ImageEditor method params

Name Description
image dart.typed_data.Uint8List
file dart.io.File
imageEditorOption flutter_image_editor.ImageEditorOption

ImageEditorOption

final editorOption = ImageEditorOption();
editorOption.addOption(FlipOption());
editorOption.addOption(ClipOption());
editorOption.addOption(RotateOption());
editorOption.addOption(); // and other option.

editorOption.outputFormat = OutputFormat.png(88);

Option

Flip

FlipOption(horizontal:true, vertical:false);

Clip

ClipOption(x:0, y:0, width:1920, height:1920);

Rotate

RotateOption(degree: 180);

Color Martix

ColorOption();

it's use 5x4 matrix : https://developer.android.google.cn/reference/android/graphics/ColorMatrix.html Although it is an Android document, the color matrix is also applicable to iOS.

a, b, c, d, e,
f, g, h, i, j,
k, l, m, n, o,
p, q, r, s, t

ColorOption has some factory constructor to help use change brightness, saturation and contrast. If you have more color matrix, you can open Pull Requests or issue.

Scale

ScaleOption(width,height);

After specifying the width and height, it is not clipped, but stretched to the specified width and height (Does not maintain the aspect ratio of the image).

AddText

All of unit is pixel.

final textOption = AddTextOption();
textOption.addText(
  EditorText(
    offset: Offset(0, 0),
    text: this._controller.text,
    fontSizePx: size,
    color: Colors.red,
    fontName: '', // You must register font before use. If the fontName is empty string, the text will use default system font.
  ),
);
FontManager

Here we can use FontManager to register font.

File fontFile = File(path)//;
final String fontName = await FontManager.registerFont(fontFile);

// the fontName can be use int EditorText.
final textOption = AddTextOption();
textOption.addText(
  EditorText(
    offset: Offset(0, 0),
    text: this._controller.text,
    fontSizePx: size,
    color: Colors.red,
    fontName: fontName, // You must register font before use.
  ),
);

MixImage

void mix(BlendMode blendMode) async {
  final src = await loadFromAsset(R.ASSETS_SRC_PNG);
  final dst = await loadFromAsset(R.ASSETS_DST_PNG);
  final optionGroup = ImageEditorOption();
  optionGroup.outputFormat = OutputFormat.png();
  optionGroup.addOption(
    MixImageOption(
      x: 300,
      y: 300,
      width: 150,
      height: 150,
      target: MemoryImageSource(src),
      blendMode: blendMode,
    ),
  );
  final result =
      await ImageEditor.editImage(image: dst, imageEditorOption: optionGroup);
  this.image = MemoryImage(result);
  setState(() {});
}
BlendMode

Support next BlendMode, other will be ignored. You can also see the document of flutter.

iOS android(PorterDuff.Mode) flutter(BlendMode)
kCGBlendModeClear CLEAR clear
  SRC src
  DST dst
kCGBlendModeNormal SRC_OVER srcOver
kCGBlendModeDestinationOver DST_OVER dstOver
kCGBlendModeSourceIn SRC_IN srcIn
kCGBlendModeDestinationIn DST_IN dstIn
kCGBlendModeSourceOut SRC_OUT srcOut
kCGBlendModeDestinationOver DST_OUT dstOut
kCGBlendModeSourceAtop SRC_ATOP srcATop
kCGBlendModeDestinationAtop DST_ATOP dstATop
kCGBlendModeXOR XOR xor
kCGBlendModeDarken DARKEN darken
kCGBlendModeLighten LIGHTEN lighten
kCGBlendModeMultiply MULTIPLY multiply
kCGBlendModeScreen SCREEN screen
kCGBlendModeOverlay OVERLAY overlay

DrawOption

Main class : DrawOption

Support:

  • Line
  • Rect
  • Oval
  • Points
  • Path
    • move
    • line
    • bezier2
    • bezier3

Example

Style of paint: DrawPaint, user can set lineWeight,color,style(stroke,fill).

OutputFormat

var outputFormat = OutputFormat.png();
var outputFormat = OutputFormat.jpeg(95);

ImageMerge

    final slideLength = 180.0;
    final option = ImageMergeOption(
      canvasSize: Size(slideLength * count, slideLength * count),
      format: OutputFormat.png(),
    );

    final memory = await loadFromAsset(R.ASSETS_ICON_PNG);
    for (var i = 0; i < count; i++) {
      option.addImage(
        MergeImageConfig(
          image: MemoryImageSource(memory),
          position: ImagePosition(
            Offset(slideLength * i, slideLength * i),
            Size.square(slideLength),
          ),
        ),
      );
    }
    for (var i = 0; i < count; i++) {
      option.addImage(
        MergeImageConfig(
          image: MemoryImageSource(memory),
          position: ImagePosition(
            Offset(
                slideLength * count - slideLength * (i + 1), slideLength * i),
            Size.square(slideLength),
          ),
        ),
      );
    }

    final result = await ImageMerger.mergeToMemory(option: option);
    provider = MemoryImage(result);
    setState(() {});

LICENSE

MIT Style.

Third party

Under Apache 2.0 style:

Some martix code come from android sdk.

TrueTypeParser : Use it to read font name.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].