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

Capture a processed photo on iOS

Capture the current Nosmai preview as a UIImage after the active effects have been rendered.

Platform iOS SDK version 3.0.4 Updated Aug 22, 2026 Time 4 min

Prerequisites

Capture the processed frame

[[NosmaiCore shared] capturePhoto:^(UIImage *image, NSError *error) {
    dispatch_async(dispatch_get_main_queue(), ^{
        if (image != nil) {
            self.photoPreview.image = image;
            return;
        }

        NSLog(@"Nosmai photo capture failed: %@", error.localizedDescription);
    });
}];

The returned image includes the effects visible in the Nosmai preview. The SDK does not save it to Photos automatically.

Save only when requested

Add NSPhotoLibraryAddUsageDescription to Info.plist before saving to the user's photo library. Keep capture and save as separate actions so the user can review or discard the image first.

Verify it worked

Apply a visible effect, capture once, and compare the returned UIImage with the preview. Confirm that the completion block returns no error.

Common errors

SymptomCauseFix
image is nilThe camera or processing pipeline is not readyCapture after the processed preview is visible and inspect error
Saving to Photos failsThe app is missing photo-library permissionAdd NSPhotoLibraryAddUsageDescription and request access before saving

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