Nosmai  Effects Nosmai  Moderation Nosmai Try-ons coming soon
Docs menu Flutter
How-to guide

Capture a processed photo in Flutter

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

Platform Flutter SDK version 1.0.2 Updated Aug 22, 2026 Time 5 min

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

Was this page helpful?

Your response helps us prioritize documentation improvements.

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