image_pixels
4.0.4, released yesterday by glasberg.dev
Build widgets depending on image dimensions and pixel colors.
WASM-ready
What it does
Allows you to extend the background color of an image to match its edges, or build custom widgets depending on an image's width, height, and pixel colors.
AI-written summary of version 4.0.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to dynamically match a container's background color to an image's edge pixels.
- You need to read pixel colors or dimensions of an image within a widget builder.
- You want to detect tapped pixel colors on an image using a GestureDetector.
Skip it when
- You only need basic image loading and caching without pixel manipulation.
- You are performing heavy real-time image processing operations on large video streams.
Strengths
- Provides direct access to image pixel colors and dimensions via an easy builder pattern.
- Supports multiple platforms including Android, iOS, Web, Windows, macOS, and Linux.
Weaknesses
- Not documented for heavy, performant off-screen image manipulation at scale.
- Dependent on image loading availability.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
No special native permissions or build steps required.
ImagePixels(
imageProvider: imageProvider,
defaultColor: Colors.grey,
builder: (context, img) => Text("Img size is: ${img.width} × ${img.height}"),
)Alternatives
Packages that do the same job and could replace image_pixels.
- cached_network_image
If you primarily need to load and cache network images with placeholders and error handling rather than inspecting pixel colors.
91Compare - image
If you need a comprehensive Dart library for image decoding, encoding, and heavy image manipulation outside of the widget tree.
96Compare