Package selection guidance compiled from public package information, community data, and project usage.
Photofilters is a Flutter package that enables developers to apply a wide range of visual filters to images within their apps. It supports both built-in filters and custom filter creation, allowing users to design unique subfilters. The package is ideal for photo editing features in mobile and desktop applications. With support across Android, iOS, macOS, Windows, and Linux, it offers cross-platform consistency. Its intuitive API simplifies integration into existing projects.
Use cases
Image editing in photo apps
Adding creative effects to user-uploaded photos
Building customizable photo filter galleries
Enhancing social media app photo sharing
Creating artistic image transformation tools
Key features
Support for built-in and custom filters
Ability to create subfilters
Cross-platform compatibility
Easy integration with Flutter
Lightweight and performant rendering
Suitable for
Developers building photo editing apps
Creative tool creators
Cross-platform multimedia applications
UI designers seeking visual enhancements
Apps requiring real-time image filtering
Considerations
Requires understanding of image processing basics
Custom filter creation may need trial and error
Performance may vary on lower-end devices
Limited documentation beyond basic examples
May require additional asset management for complex filters
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Photo Filters package for flutter
A flutter package for iOS and Android for applying filter to an image. A set of preset filters are also available. You can create your own filters too.
There are two types of filters. ImageFilter and ColorFilter.
Image Filter
Image filter applies its subfilters directly to the whole image one by one. It is computationally expensive since the complexity & time increases as the number of subfilters increases.
You can create your own custom image filter as like this:
Color filter applies its subfilters to each pixel one by one. It is computationally less expensive than the ImageFilter. It will loop through the image pixels only once irrespective of the number of subfilters.
You can create your own custom color filter as like this:
import'package:photofilters/filters/color_filters.dart';
var customColorFilter = newColorFilter(name: "Custom Color Filter");
customColorFilter.addSubFilter(SaturationSubFilter(0.5));
customColorFilter
.addSubFilters([BrightnessSubFilter(0.5), HueRotationSubFilter(30)]);
You can inherit the ColorFilter class too
classMyColorFilterextendsColorFilter{
MyColorFilter() : super(name: "My Custom Color Filter") {
this.addSubFilter(BrightnessSubFilter(0.8));
this.addSubFilter(HueRotationSubFilter(30));
}
}
Sub filters
There are two types of subfilters. One can be added to the ColorFilter and the other can be added to the ImageFilter. You can inherit ColorSubFilter class to implement the former and you can use the ImageSubFilter mixin to implement the latter. You can create a same subfilter that can be used for both Image and Color Filters. The BrightnessSubFilter is an example of this.
classBrightnessSubFilterextendsColorSubFilterwithImageSubFilter{
finalnum brightness;
BrightnessSubFilter(this.brightness);
///Apply the [BrightnessSubFilter] to an Image.@overridevoidapply(Uint8List pixels, int width, int height) =>
image_filter_utils.brightness(pixels, brightness);
///Apply the [BrightnessSubFilter] to a color.@override
RGBA applyFilter(RGBA color) =>
color_filter_utils.brightness(color, brightness);
}
Getting Started
For help getting started with Flutter, view our online documentation.
For help on editing package code, view the documentation.