A flutter package uses native implementations to resize an image

Overview

fast_image_resizer

This package uses native implementations to resize an image. It should be fast compared to the image package. It only supports PNG as output at the moment.

This package has zero dependencies.

Features

  • Supported inputs: JPEG, PNG, GIF, Animated GIF, WebP, Animated WebP, BMP, and WBMP
  • Supported outputs: PNG

Getting started

Add fast_image_resizer to your pubspec.yaml

Usage

import 'package:fast_image_resizer/fast_image_resizer.dart';
import 'dart:typed_data';
final rawImage = await rootBundle.load('assets/someImage.png');
final bytes = await resizeImage(Uint8List.view(rawImage.buffer), width: 150);
if (bytes != null) {
    final imageWidget = Image.memory(Uint8List.view(bytes.buffer));
    showDialog(
        context: context,
        builder: (BuildContext context) {
            return AlertDialog(
            title: const Text("Image"),
            content: imageWidget,
            );
        }
    );
}

or

final ImagePicker _picker = ImagePicker();
final XFile? image =
    await _picker.pickImage(source: ImageSource.gallery);
if (image != null) {
    final rawImage = await image.readAsBytes();
    final bytes = await resizeImage(Uint8List.view(rawImage.buffer), height: 250);
    if (bytes != null) {
        final testing = Image.memory(Uint8List.view(bytes.buffer));
        showDialog(
            context: context,
            builder: (BuildContext context) {
                return AlertDialog(
                    title: Text("Image"),
                    content: testing,
                );
            }
        );
    }
}
You might also like...

how to Integrating facebook audience network to flutter app for banner, interstitial, rewarded, native and native banner

fb_ads_flutter_12 A new Flutter project. Getting Started Watch the complite tutorial for integrating Facebook ads into the Flutter app in our Youtube

Nov 26, 2022

Flutter native ads - Show AdMob Native Ads use PlatformView

Flutter native ads - Show AdMob Native Ads use PlatformView

flutter_native_ads Flutter plugin for AdMob Native Ads. Compatible with Android and iOS using PlatformView. Android iOS Getting Started Android Androi

Dec 20, 2022

react-native native module for In App Purchase.

react-native native module for In App Purchase.

Documentation Published in website. Announcement Version 8.0.0 is currently in release candidate. The module is completely rewritten with Kotlin and S

Dec 31, 2022

dna, dart native access. A lightweight dart to native super channel plugin

dna, dart native access. A lightweight dart to native super channel plugin, You can use it to invoke any native code directly in contextual and chained dart code.

Jul 11, 2022

Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Image Zoom and Cropping plugin for Flutter A simple and easy used flutter plugin to crop image on iOS and Android. Installation Add simple_image_crop

Dec 14, 2021

Form builder image picker - Form builder image picker for flutter

form_builder_image_picker Field for picking image(s) from Gallery or Camera for

Jan 28, 2022

Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort.

Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort.

flutter_image_add_drag_sort Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort, support video fi

Jun 23, 2020

Dart library for decoding/encoding image formats, and image processing.

image Overview A Dart library providing the ability to load, save and manipulate images in a variety of different file formats. The library is written

Dec 27, 2022

A simple and customizable flutter package for inputting phone number in intl / international format uses Google's libphonenumber

A simple and customizable flutter package for inputting phone number in intl / international format uses Google's libphonenumber

Intl Phone Number Input A simple and customizable flutter package for inputting phone number in intl / international format uses Google's libphonenumb

Dec 11, 2022
Comments
  • Support different image formats

    Support different image formats

    • Support all image formats from dart.ui.ImageByteFormat I created a new enum ImageFormat with all values from ImageByteFormat in case more formats will be added to the library
    • Use a new flutter app in examples
    opened by nWacky 2
Owner
Soeren Schoenbrod
Soeren Schoenbrod
A flutter app for image and text, rotate, resize and flip

image_demo A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if th

null 0 Jan 4, 2022
A powerful plugin that fully uses the native image library's ability to display images on the flutter side.

PowerImage A powerful plugin that fully uses the native image library's ability to display images on the flutter side. 中文文档 Features: Supports the abi

Alibaba 422 Dec 23, 2022
Morphing Coffee 0 Jan 27, 2022
Flutter Easy Getx Implementations .

Flutter Easy GetX Description People ask me how I manage state,dependency,routes etc when I work with flutter,Here is the Simple Brief About GetX whic

Tasnuva Tabassum oshin 13 Oct 18, 2022
100+ Professional UI implementations with Code in Flutter. Available in Android, iOS, Linux and Web

Flutter UI Challenges My effort on replicating various apps UI on flutter. View on Web Building and running the code [ Updated ] Thank you all for you

Damodar Lohani 4k Dec 28, 2022
Flutter plugin for auto resize widgets to get then "responsives".

Responsive Widgets This plugin helps to create responsive widgets, that makes auto-size with the proportion between reference screen size (width, heig

Lucas Henrique Polazzo 45 Nov 3, 2022
A Flutter plugin to rotate, resize, move, delete text, photo or any other widget.

sticker_view A Flutter plugin to rotate, resize, move, delete any text, image or any other widget. Available Features ✅ Rotate ✅ Resize ✅ Move ✅ Layer

Gopal Dhola 14 Nov 26, 2022
A flutter package to cache network image fastly without native dependencies.

Fast Cached Network Image A flutter package to cache network image fastly without native dependencies, with loader, error builder, and smooth fade tra

CHRISTO 3 Sep 22, 2022
Album Image is based in photo_manager package and has the same concept as image_picker but with a more attractive interface to choose an image or video from the device gallery, whether it is Android or iOS

Album Image is based in photo_manager package and has the same concept as image_picker but with a more attractive interface to choose an image or vide

Phuong Vu 2 Oct 13, 2022