श्रेणियाँ, पैकेज और रिपॉज़िटरी खोजें

flutter_image_filters कवर
पैकेज विवरणv0.0.32

flutter_image_filters

OpenGL(SPIR-V) फ्रैगमेंट शेडर्स पर आधारित छवि फ़िल्टर उपयोगी प्रीव्यू विजेट्स के साथ

AndroidiOSWebmacOS
30-दिन डाउनलोड
5.4 हज़ार
लाइक
82
Pub अंक
140

पैकेज इंस्टॉल करें

flutter pub add flutter_image_filters

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक फ्लटर पैकेज जो OpenGL (SPIR-V) फ्रैगमेंट शेडर का उपयोग करके छवि फिल्टर लागू करता है, जिससे उच्च प्रदर्शन विजुअल प्रभाव संभव होते हैं। यह रियल-टाइम में फिल्टर परिणामों को देखने के लिए प्रीव्यू विजेट्स शामिल करता है, जिससे यह डायनामिक छवि संपादन की आवश्यकता वाले ऐप्स के लिए आदर्श होता है। यह पैकेज Android, iOS, Web और macOS जैसे कई प्लेटफॉर्म का समर्थन करता है, जिससे व्यापक संगतता सुनिश्चित होती है। डेवलपर्स कस्टम शेडर को एकीकृत कर सकते हैं या ब्लर, ब्राइटनेस, कॉन्ट्रास्ट आदि जैसे प्रभाव के लिए निर्मित फिल्टर का उपयोग कर सकते हैं। दक्षता और उपयोग में आसानी के लिए डिज़ाइन किया गया है, यह फोटो एडिटिंग टूल्स, क्रिएटिव ऐप्स और किसी भी ऐप के लिए उपयुक्त है जिसमें न्यूनतम ओवरहेड के साथ रियल-टाइम छवि प्रसंस्करण की आवश्यकता होती है।

उपयोग

  • रियल-टाइम फोटो संपादन
  • रचनात्मक ऐप विकास
  • छवि सुधार टूल
  • मल्टीमीडिया ऐप में विजुअल प्रभाव
  • लागू करने से पहले फ़िल्टर प्रभावों का पूर्वावलोकन करें

मुख्य विशेषताएँ

  • OpenGL-आधारित फ्रैगमेंट शेडर्स
  • रियल-टाइम प्रीव्यू विजेट्स
  • क्रॉस-प्लेटफॉर्म समर्थन (Android, iOS, Web, macOS)
  • उच्च प्रदर्शन रेंडरिंग
  • कस्टम और बिल्ट-इन फ़िल्टर का समर्थन

इनके लिए उपयुक्त

  • फोटो एडिटिंग ऐप्स बनाने वाले डेवलपर्स
  • रचनात्मक उपकरण निर्माता
  • वास्तविक समय छवि प्रसंस्करण की आवश्यकता वाले ऐप
  • कई प्लेटफॉर्म के लिए फ्लटर विकासकर्ता
  • प्रभावी शेडर-आधारित छवि प्रभाव चाहने वाले उपयोगकर्ता

विचार योग्य बातें

  • फ्रैगमेंट शेडर की समझ की आवश्यकता है
  • कम शक्तिशाली उपकरणों पर GPU का उपयोग अधिक हो सकता है
  • छवि फ़िल्टरिंग पर सीमित (सामान्य ग्राफ़िक्स नहीं)
  • स्थिर या वीडियो फ्रेम के लिए सबसे उपयुक्त, एनीमेशन के लिए नहीं
  • प्लेटफॉर्म-विशिष्ट शेडर संकलन को परीक्षण की आवश्यकता हो सकती है

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Pub codecov build Star on Github License: MIT

A flutter package for iOS and Android for applying OpenGL filters to image.

Usage

How to generate and use a bunch of filters
How to add custom filters
Export processed image
final texture = await TextureSource.fromAsset('demo.jpeg');
final configuration = BrightnessShaderConfiguration();
configuration.brightness = 0.5;
final image = await configuration.export(texture, texture.size);
Pipeline export

In case you see performance issues, look on how to generate and use bunch of filters

final texture = await TextureSource.fromAsset('demo.jpeg');
final brConfig = BrightnessShaderConfiguration();
brConfig.brightness = 0.5;

final stConfig = SaturationShaderConfiguration();
stConfig.saturation = 0.5;

final configuration = GroupShaderConfiguration();
configuration.add(brConfig);
configuration.add(stConfig);
final result = await configuration.export(texture, texture.size);
LookupTable sample

LUT

final texture = await TextureSource.fromAsset('demo.jpeg');
final configuration = SquareLookupTableShaderConfiguration();
await configuration.setLutAsset('lookup_amatorka.png');
final image = await configuration.export(texture, texture.size);
LookupTable HALD sample

LUT

final texture = await TextureSource.fromAsset('demo.jpeg');
final configuration = HALDLookupTableShaderConfiguration();
await configuration.setLutAsset('lookup_hald.png');
final image = await configuration.export(texture, texture.size);
ImageShaderPreview example
import 'package:flutter_image_filters/flutter_image_filters.dart';

class PreviewPage extends StatefulWidget {
  const PreviewPage({Key? key}) : super(key: key);

  @override
  State<PreviewPage> createState() => _PreviewPageState();
}

class _PreviewPageState extends State<PreviewPage> {
  late TextureSource texture;
  late BrightnessShaderConfiguration configuration;
  bool textureLoaded = false;

  @override
  void initState() {
    super.initState();
    configuration = BrightnessShaderConfiguration();
    configuration.brightness = 0.5;
    TextureSource.fromAsset('demo.jpeg')
        .then((value) => texture = value)
        .whenComplete(
          () => setState(() {
            textureLoaded = true;
          }),
        );
  }

  @override
  Widget build(BuildContext context) {
    return textureLoaded
        ? ImageShaderPreview(
            texture: texture,
            configuration: configuration,
          )
        : const Offstage();
  }
}
PipelineImageShaderPreview example
class PreviewPage extends StatefulWidget {
  const PreviewPage({Key? key}) : super(key: key);

  @override
  State<PreviewPage> createState() => _PreviewPageState();
}

class _PreviewPageState extends State<PreviewPage> {
  late TextureSource texture;
  late GroupShaderConfiguration configuration;
  bool textureLoaded = false;

  @override
  void initState() {
    super.initState();
    configuration = GroupShaderConfiguration();
    configuration.add(BrightnessShaderConfiguration()..brightness = 0.5);
    configuration.add(SaturationShaderConfiguration()..saturation = 0.5);
    TextureSource.fromAsset('demo.jpeg')
        .then((value) => texture = value)
        .whenComplete(
          () => setState(() {
        textureLoaded = true;
      }),
    );
  }

  @override
  Widget build(BuildContext context) {
    return textureLoaded
        ? PipelineImageShaderPreview(
      texture: texture,
      configuration: configuration,
    )
        : const Offstage();
  }
}
Divided preview sample
import 'package:before_after_image_slider_nullsafty/before_after_image_slider_nullsafty.dart';
import 'package:flutter_image_filters/flutter_image_filters.dart';

class PreviewPage extends StatefulWidget {
  const PreviewPage({Key? key}) : super(key: key);

  @override
  State<PreviewPage> createState() => _PreviewPageState();
}

class _PreviewPageState extends State<PreviewPage> {
  late TextureSource texture;
  late BrightnessShaderConfiguration configuration;
  bool textureLoaded = false;

  @override
  void initState() {
    super.initState();
    configuration = BrightnessShaderConfiguration();
    configuration.brightness = 0.5;
    TextureSource.fromAsset('demo.jpeg')
        .then((value) => texture = value)
        .whenComplete(
          () => setState(() {
            textureLoaded = true;
          }),
        );
  }

  @override
  Widget build(BuildContext context) {
    return textureLoaded
        ? BeforeAfter(
            thumbRadius: 0.0,
            thumbColor: Colors.transparent,
            beforeImage: ImageShaderPreview(
              texture: texture,
              configuration: NoneShaderConfiguration(),
            ),
            afterImage: ImageShaderPreview(
              texture: texture,
              configuration: configuration,
            ),
          )
        : const Offstage();
  }
}
Export & save processed image
import 'package:image/image.dart' as img;
import 'package:path_provider/path_provider.dart';



final texture = await TextureSource.fromAsset('demo.jpeg');
final configuration = BrightnessShaderConfiguration();
configuration.brightness = 0.5;
final image = await configuration.export(texture, texture.size);

final directory = await getTemporaryDirectory();
final output =
File('${directory.path}/result.jpeg');
final bytes = await image.toByteData();
final persistedImage = img.Image.fromBytes(
  image.width,
  image.height,
  bytes!.buffer.asUint8List(),
);
img.JpegEncoder encoder = img.JpegEncoder();
final data = encoder.encodeImage(persistedImage);
await output.writeAsBytes(data);

Additional information

Support status of GPUImage for iOS and GPUImage for Android shaders
Status Name
:white_check_mark: Brightness
:white_check_mark: Bulge Distortion
:white_check_mark: CGA Colorspace
:white_check_mark: Color Invert
:white_check_mark: Color Matrix
:white_check_mark: Contrast
:white_check_mark: Crosshatch
:white_check_mark: Exposure
:white_check_mark: False Color
:white_check_mark: Gamma
:white_check_mark: Glass Sphere
:white_check_mark: Grayscale
:white_check_mark: Halftone
:white_check_mark: Haze
:white_check_mark: Highlight Shadow
:white_check_mark: Hue
:white_check_mark: Lookup Table
:white_check_mark: Luminance
:white_check_mark: Luminance Threshold
:white_check_mark: Monochrome
:white_check_mark: Opacity
:white_check_mark: Pixelation
:white_check_mark: Posterize
:white_check_mark: RGB
:white_check_mark: Saturation
:white_check_mark: Solarize
:white_check_mark: Swirl
:white_check_mark: Vibrance
:white_check_mark: Vignette
:white_check_mark: White Balance
:white_check_mark: Zoom Blur
Sample results

Brightness Bulge Distortion CGA Colorspace Color Invert Color Matrix Contrast Crosshatch Exposure False Color Gamma Grayscale Halftone Haze Highlight Shadow Hue Square Lookup Table Luminance Threshold Luminance Monochrome Opacity Pixelation Posterize RGB Saturation Solarize Swirl Vibrance Vignette White Balance Zoom Blur

Examples

Maintainers

श्रेणियाँ

निर्भरताएँ

निर्भरता सूची 5 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।