Effects Flutter
Effects / Guides / Photo capture / Flutter

Capture an AR-filtered photo in Flutter with Nosmai Effects

Updated August 22, 2026

Capture the current processed preview and optionally save the returned image bytes to the device gallery.

Prerequisites

Capture the processed frame

final nosmai = NosmaiFlutter.instance;
final photo = await nosmai.capturePhoto();

if (!photo.success || photo.imageData == null) {
  throw StateError(photo.error ?? 'Photo capture failed');
}

final bytes = photo.imageData!;

imageData contains the captured image with the active Nosmai effects.

final saved = await nosmai.saveImageToGallery(
  bytes,
  name: 'nosmai-photo',
);

Saving is optional. Request the platform photo-library permission when the host application requires it.

Verify it worked

Apply a visible filter, capture once, and confirm photo.success is true, the byte list is not empty, and the saved image contains the same effect.

Common errors

SymptomCauseFix
photo.success is falseThe native preview is not readyCapture after onInitialized
Save failsGallery access is missing or deniedAdd the platform usage description and request permission

Next steps

References

Nosmai

An AR and AI company. Founded on the idea that the next decade of software will be visual, and that the tools for it should be within reach of anyone building.

Newsletter

Product updates and release notes. No spam.

© 2026 nosmai, inc · all rights reserved