
Powerful image editor inspired by Instagram Stories. Effortlessly edit and manipulate text and images with intuitive gestures, supporting text customization, image overlays, layer management, and export features.
Memento is a powerful and customizable image editor library for Kotlin Multiplatform, inspired by Instagram Stories. It allows you to effortlessly add, edit, and manipulate text and images on a canvas, all with intuitive gestures.
Built with Jetpack Compose for Multiplatform, Memento provides a seamless experience on both Android and iOS.
MementoController to manage the state of your creations.ImageBitmap.Memento is available on Maven Central.
Make sure you have mavenCentral() in your top-level build.gradle.kts file:
repositories {
mavenCentral()
}Add the desired dependency to your module's build.gradle.kts file:
dependencies {
// For the full UI editor experience (includes core)
implementation("my.takealook.memento:memento-ui:<latest-version>")
// Or if you only need the core logic
implementation("my.takealook.memento:memento-core:<latest-version>")
}Always check for the latest version on Maven Central.
Getting started with the MementoEditor is simple. Just add the composable to your UI:
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import my.takealook.memento.MementoEditor
import my.takealook.memento.rememberMementoController
@Composable
fun MyEditorScreen() {
val mementoController = rememberMementoController()
MementoEditor(
modifier = Modifier.fillMaxSize(),
controller = mementoController,
onImageCaptured = { imageBitmap ->
// Handle the captured image
},
mainContent = {
// Your main content goes here, e.g., an Image
Image(
painter = painterResource(Res.drawable.my_background_image),
contentDescription = "Background"
)
}
)
// You can control the editor externally
Button(onClick = { mementoController.requestCapture() }) {
Text("Save Image")
}
}memento-core: Contains the core logic, state management (MementoController, MementoState), and data classes. It's UI-agnostic.memento-ui: Provides the MementoEditor Composable and other UI components built on memento-core for a ready-to-use editor experience.Memento is also available on Swift Package Manager.
You can add MementoUI to your Xcode project as a Swift Package.
File > Add Packages...
https://github.com/easternkite/memento.git
MementoUi product.Here's a basic example of how to integrate MementoUI into your SwiftUI application.
First, ensure you import MementoUi in your Swift files:
import SwiftUI
import UIKit
import MementoUi
struct ComposeView: UIViewControllerRepresentable {
var controller : MementoController!
init(_ controller: MementoController) {
self.controller = controller
}
func makeUIViewController(context: Context) -> UIViewController {
return MementoEditorViewControllerKt.MementoEditorViewController(
mainContent: UIImage(named: "ic_milk")!,
controller: controller,
onImageCaptured: { image in saveImageToGallery(image) }
)
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}
struct ContentView: View {
@State var controller: MementoController = MementoController()
var body: some View {
ZStack(alignment: .topTrailing) {
ComposeView(controller)
.ignoresSafeArea(.all) // Compose has own keyboard handler
//...
}
}
}For optimal performance and smooth animations, especially on iOS devices, it is crucial to add the CADisableMinimumFrameDurationOnPhone key to your application's Info.plist file and set its value to YES (Boolean).
This setting disables a system-imposed minimum frame duration, allowing your app to render at higher frame rates when possible, which is particularly beneficial for UI-intensive applications like image editors.
How to add it:
Info.plist file in Xcode.Add Row.Key, enter CADisableMinimumFrameDurationOnPhone.Type, select Boolean.Value, set it to YES.Alternatively, you can add the following XML snippet directly to your Info.plist file:
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>This project is licensed under the Apache License, Version 2.0. See the LICENSE.txt file for details.
Memento is a powerful and customizable image editor library for Kotlin Multiplatform, inspired by Instagram Stories. It allows you to effortlessly add, edit, and manipulate text and images on a canvas, all with intuitive gestures.
Built with Jetpack Compose for Multiplatform, Memento provides a seamless experience on both Android and iOS.
MementoController to manage the state of your creations.ImageBitmap.Memento is available on Maven Central.
Make sure you have mavenCentral() in your top-level build.gradle.kts file:
repositories {
mavenCentral()
}Add the desired dependency to your module's build.gradle.kts file:
dependencies {
// For the full UI editor experience (includes core)
implementation("my.takealook.memento:memento-ui:<latest-version>")
// Or if you only need the core logic
implementation("my.takealook.memento:memento-core:<latest-version>")
}Always check for the latest version on Maven Central.
Getting started with the MementoEditor is simple. Just add the composable to your UI:
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import my.takealook.memento.MementoEditor
import my.takealook.memento.rememberMementoController
@Composable
fun MyEditorScreen() {
val mementoController = rememberMementoController()
MementoEditor(
modifier = Modifier.fillMaxSize(),
controller = mementoController,
onImageCaptured = { imageBitmap ->
// Handle the captured image
},
mainContent = {
// Your main content goes here, e.g., an Image
Image(
painter = painterResource(Res.drawable.my_background_image),
contentDescription = "Background"
)
}
)
// You can control the editor externally
Button(onClick = { mementoController.requestCapture() }) {
Text("Save Image")
}
}memento-core: Contains the core logic, state management (MementoController, MementoState), and data classes. It's UI-agnostic.memento-ui: Provides the MementoEditor Composable and other UI components built on memento-core for a ready-to-use editor experience.Memento is also available on Swift Package Manager.
You can add MementoUI to your Xcode project as a Swift Package.
File > Add Packages...
https://github.com/easternkite/memento.git
MementoUi product.Here's a basic example of how to integrate MementoUI into your SwiftUI application.
First, ensure you import MementoUi in your Swift files:
import SwiftUI
import UIKit
import MementoUi
struct ComposeView: UIViewControllerRepresentable {
var controller : MementoController!
init(_ controller: MementoController) {
self.controller = controller
}
func makeUIViewController(context: Context) -> UIViewController {
return MementoEditorViewControllerKt.MementoEditorViewController(
mainContent: UIImage(named: "ic_milk")!,
controller: controller,
onImageCaptured: { image in saveImageToGallery(image) }
)
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}
struct ContentView: View {
@State var controller: MementoController = MementoController()
var body: some View {
ZStack(alignment: .topTrailing) {
ComposeView(controller)
.ignoresSafeArea(.all) // Compose has own keyboard handler
//...
}
}
}For optimal performance and smooth animations, especially on iOS devices, it is crucial to add the CADisableMinimumFrameDurationOnPhone key to your application's Info.plist file and set its value to YES (Boolean).
This setting disables a system-imposed minimum frame duration, allowing your app to render at higher frame rates when possible, which is particularly beneficial for UI-intensive applications like image editors.
How to add it:
Info.plist file in Xcode.Add Row.Key, enter CADisableMinimumFrameDurationOnPhone.Type, select Boolean.Value, set it to YES.Alternatively, you can add the following XML snippet directly to your Info.plist file:
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>This project is licensed under the Apache License, Version 2.0. See the LICENSE.txt file for details.