I couldn't find a way to embed animated stickers from iMessage into websites. So, I wrote my own solution. I hope it helps you too!
This project allows you to convert animated Memoji from .mov
format to Lottie.
Lottie is a powerful animation format that is well-suited for web applications
because it supports transparent backgrounds and is lightweight. The default
export from iMessage is in .mov
format, which not only has a dark background
but is also not intended for direct use on websites. This project aims to
provide a better alternative by converting those animations into the Lottie
format.
- Convert
.mov
animated Memoji to Lottie format. - Remove dark backgrounds using the OpenCV library.
- Convert each frame to
.webp
format for efficient web use. - Generate a Lottie JSON file ready for embedding in web projects.
-
Clone this repository:
git clone https://github.com/machnevegor/memoji cd memoji
-
Install the dependencies using Poetry:
poetry install
-
Create your animated Memoji in iMessage. For guidance, check out this support article.
-
Export the Memoji as a
.mov
file to the data/ directory. -
Open the Jupyter Notebook notebook.ipynb.
-
Update the
INPUT_VIDEO
andOUTPUT_JSON
paths in the notebook to point to your.mov
file and desired output JSON file. -
Run the cells in the notebook to process the animation.
-
Check the output: Review the generated JSON file to ensure it meets your quality standards.
-
Copy the generated JSON file to your website. Enjoy!
- The conversion process includes a compression step when generating
.webp
files. Please note that this process is not lossless, meaning some quality may be reduced. Make sure to review the output to ensure it meets your needs. - If you encounter any issues or have questions, feel free to open an issue in this repository.
Contributions are welcome! If you have suggestions or improvements, please create a pull request or open an issue.