Effects Android
Effects / Reference / API reference / Android
Updated August 27, 2026

Look up the public Android 3.0.4 lifecycle, preview, effects, beauty, Cloud Filters, recording, and output APIs.

Entry points

TypePurpose
NosmaiSDKInitialization, processing, package slots, recording, and off-screen output
NosmaiPreviewViewGPU preview, Camera2 input surface, lifecycle, recording surface, and texture callbacks
NosmaiBeautyBeauty, colour, makeup, reshape, eye colour, hair colour, and manual backgrounds
NosmaiCloudLicensed cloud catalog, pagination, cache state, download, and progress
NosmaiEffectsAuthored package metadata and runtime parameter controls

Initialize and process

APIResult
NosmaiSDK.initialize(context, licenseKey)Initializes the process-wide native runtime
NosmaiSDK.isInitialized()Reports whether initialization was accepted
NosmaiSDK.startProcessing(previewView)Connects processing to a prepared NosmaiPreviewView
NosmaiSDK.stopProcessing()Stops processing while preserving the initialized runtime
NosmaiSDK.cleanup()Releases process-wide SDK resources
NosmaiPreviewView.onResume() / onPause()Mirrors the owning Activity or Fragment lifecycle

Apply and clear packages

APINotes
NosmaiSDK.applyEffect(path)Applies a downloaded Cloud Filter
NosmaiSDK.clearAREffect()Clears the AR-effect slot
NosmaiSDK.clearFilter()Clears the colour-filter slot
NosmaiSDK.clearAllEffects()Clears all active effect state
NosmaiEffects.applyEffect(path, callback)Applies a package with an operation-result callback
NosmaiEffects.clearBackgroundPackage()Clears only the authored background-package slot

Apply package mutations serially and check the returned boolean. Do not pass a URL, cloud identifier, query string, or partial download to a path method.

Runtime parameters

Use NosmaiEffects.getEffectParameters() after applying an authored package. Update numeric, integer, or Boolean controls with setEffectParameter(name, float) and text controls with setEffectParameter(name, String). Read numeric values with getEffectParameterValue(name) and treat Float.NaN as unavailable. Parameter names, types, ranges, and options belong to the active package.

Cloud Filters

Call NosmaiCloud.isEnabled() before showing cloud-only controls. Use NosmaiCloud.fetch(query), inspect NosmaiCloud.list() and NosmaiCloud.pagination(), then call NosmaiCloud.download(filterId, ...). The download callback returns the verified local path that can be passed to NosmaiSDK.applyEffect(path). NosmaiCloud.cachedList() reports the SDK cache; lastError() provides a public diagnostic without exposing service routes.

Beauty and backgrounds

Call beauty APIs after the processing pipeline is ready. Standard strengths use 0.0f...1.0f; signed reshape controls use -1.0f...1.0f; contour, highlighter, lipstick, and blusher support 0.0f...2.0f. Values are clamped and are not interpreted as percentages.

APIContract
NosmaiBeauty.prepareBeautyModels()Optional cold-start preparation. Call on a background startup thread after the pipeline is ready; it does not apply an effect.
NosmaiBeauty.setBeautyVisible(visible) / isBeautyVisible()Hides or restores built-in beauty without clearing its configured values. AR packages and backgrounds remain visible.
applyContourHighlighter(contour, highlight)Independent sculpting strengths from 0.0f...2.0f.
applyFreckles(quantity)Freckle quantity from 0.0f...1.0f.
applyFoundation(coverage, r, g, b) / removeFoundation()Foundation coverage and RGB components from 0.0f...1.0f.
applyDarkCircleCorrector(intensity)Under-eye correction from 0.0f...1.0f.
setHairColoringEnabled, setHairColor, setHairColorIntensity, isHairColoringEnabledControls the optional hair-colour layer; RGB and intensity use 0.0f...1.0f.

The remaining NosmaiBeauty surface includes skin smoothing, skin whitening, teeth whitening, sharpening, colour adjustments, eye colour, makeup layers, signed reshape controls, background blur, background image, and background colour. Use the matching remove or clear method instead of clearing unrelated package slots.

Makeup styles and colours

The style-based NosmaiBeauty methods are applyLipstickStyle, applyEyeshadowStyle, applyBlusherStyle, applyEyelashStyle, and applyEyebrowStyle. Use their named style constants and normalized RGB components. Lipstick also supports an optional Android packed colour; eyelashes do not take a custom colour.

Update a layer with setMakeupIntensity(category, value), remove it with removeMakeup(category), and query it with isMakeupActive(category). The selectors are MAKEUP_LIPSTICK, MAKEUP_EYESHADOW, MAKEUP_BLUSHER, MAKEUP_EYELASH, and MAKEUP_EYEBROW; MAKEUP_ALL selects all makeup layers for removal or an active-state query.

Lipstick and blush accept 0...2 strength; the other three layers accept 0...1. Supply app-owned palette shades through the RGB methods. See Makeup styles and palettes for the standard styles, custom colours, and update/remove examples.

Face reshaping

NosmaiBeauty.setReshape(type, value) accepts a signed -1...1 strength; 0 is neutral. The published type IDs are lip size 0, face slim 1, eye size 2, nose size 3, chin 4, brow position 5, brow thickness 6, jaw 7, mouth width 8, and forehead 9. Multiple types can be active. Set one type to 0 to reset it, or call clearReshapes() for all unified shape controls without requesting a full beauty reset.

The applyMorph... convenience methods have their own ranges. The older applyFaceSlimming, applyEyeEnlargement, and applyNoseSize methods are not signed equivalents; applyNoseSize(0.5f) is neutral. Do not mix API families for one control. See Face reshaping for type directions, exact convenience ranges, slider conversion, and resets.

Runtime face stickers

Use NosmaiSDK.setFaceSticker(...) with a Bitmap or encoded PNG, JPEG, or GIF bytes. Choose a NosmaiEffects.FaceStickerAnchor such as EYES, NOSE, or MOUTH; adjust the live placement with setFaceStickerPlacement(...). Use isFaceStickerActive() for state and clearFaceSticker() to release the sticker. Animated GIF timing is handled by the SDK. The face sticker shares the AR overlay slot, so applying another AR effect replaces it.

Eye and hair colouring

NosmaiBeauty.applyEyeLens(r, g, b, intensity) colours the iris/contact-lens area. Use setEyeLensIntensity, isEyeLensActive, and removeEyeLens for updates, configured state, and removal. Sclera-colouring compatibility methods are not a supported recolouring feature in this release.

Hair uses setHairColor(r, g, b), setHairColorIntensity, and setHairColoringEnabled; query isHairColoringEnabled and disable with setHairColoringEnabled(false). All RGB and intensity components use 0...1. Enabled state is not a face/hair detection result. See Eye and hair colouring.

Active effects and events

Read NosmaiEffects.getCurrentPipelineState() and observe addPipelineStateListener / removePipelineStateListener using a NosmaiEffectsEngine.PipelineStateListener. NosmaiPipelineState exposes mode, package paths, and effective background state through getters. Use getActiveFilterInfo / getActiveEffectInfo for typed package metadata and dedicated layer queries for built-in controls.

Licence status uses NosmaiSDK.addLicenseStatusListener and its matching remove method; game events use the game listener methods on NosmaiEffects. Keep listener instances and unregister on teardown. See Active effects and events.

Recording and output

startRecording(preview, outputPath, callback) and stopRecording(callback) manage processed MP4 recording. The start method accepts no encoder-config object. Wait for onCompleted before using the file; see Recording configuration.

enableOesInput, addOnOesReadyListener, setOesInputFrameInfo, and processYuvFrame configure preview-backed input. Frame-info/YUV rotation is a mode ID; standalone I420 methods instead take degrees.

setTextureFrameCallback returns a processed 2D texture and a fence as its fifth argument. Use the texture ID with waitStreamFrame before sampling, then completeStreamFrame after a GPU copy, or releaseStreamSlot for an unused frame. Do not cast the fence to a slot index. Register the EGL share context before initialization and drain consumers before shutdown. See Custom frame pipelines for input formats, orientation, ownership, and examples.

Ownership rules

Keep one Camera2 owner and one NosmaiPreviewView per active session. Stop the previous camera before navigating to a second camera screen. Run lifecycle and view operations on the Android main thread and keep high-rate texture work out of Java object-conversion paths.

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