Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram skin recolor #30

Open
yuraiz opened this issue Oct 27, 2022 · 9 comments · May be fixed by #31
Open

Telegram skin recolor #30

yuraiz opened this issue Oct 27, 2022 · 9 comments · May be fixed by #31
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@yuraiz
Copy link
Contributor

yuraiz commented Oct 27, 2022

Telegram can recolor some animations to different skin colors
image

but it's telegram's rlottie only feature
TelegramMessenger/rlottie@67f103b

If I understand correctly I need to implement capi in optional file and add feature to use it

@msrd0
Copy link
Owner

msrd0 commented Oct 27, 2022

No, the C API isn't going to help you. The changes you linked to are only made to the C++ interface, the C interface is just a binding to that.

@yuraiz
Copy link
Contributor Author

yuraiz commented Oct 27, 2022

Looks like bindgen generate binding to C++: https://rust-lang.github.io/rust-bindgen/cpp.html

maybe I can make hpp wrapper and add load_from_data_tg function

@msrd0
Copy link
Owner

msrd0 commented Oct 27, 2022

Yeah I see basically 3 options:

  • try to use bindgen with C++, or the cxx crate to bridge to C++ directly, which is likely going to be very painful
  • write some C wrapper ourselves
  • try to apply the color replacement as post-processing in Rust

Feel free to try these out and/or suggest other options that I might've missed. The last one might be favourable as it would work with either version of rlottie.

@msrd0 msrd0 added enhancement New feature or request help wanted Extra attention is needed labels Oct 27, 2022
@yuraiz
Copy link
Contributor Author

yuraiz commented Oct 27, 2022

I made first working version
image
https://github.com/yuraiz/rlottie-rs/tree/fitz-recolor

@msrd0 msrd0 linked a pull request Oct 27, 2022 that will close this issue
@msrd0
Copy link
Owner

msrd0 commented Oct 27, 2022

It looks like this should work with Samsung version of rlottie too (Samsung/rlottie@3be663e), but with a different api.

@yuraiz
Copy link
Contributor Author

yuraiz commented Oct 28, 2022

Telegram's fitzModifier gets replacement colors from json, and recolors skin only when Samsung's colorFilter will be applied to all colors

@yuraiz
Copy link
Contributor Author

yuraiz commented Oct 28, 2022

Color filter can be useful for conversion, but I don't want to use it for skin recolor

@yuraiz
Copy link
Contributor Author

yuraiz commented Oct 28, 2022

I can make feature 'v2' and add color filter later, but 'v2' and 'tg' features will be exclusive

@yuraiz
Copy link
Contributor Author

yuraiz commented Oct 28, 2022

Telegram used to apply skin tone to faces
Screenshot_20221028-070312_Telegram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants