AnotherMike
Member
- Mar 26, 2020
- 161
- 132
- 208
Very cool ! I spent some time trying to remove the background on python side in renpy, but kept running into issues and eventually gave up.. Didn't even think of doing it on webui side with extensions, will definitely give this a try ! Now I might even feel motivated to try to see how to make the multiple people on the screen at the same time work.
Sadly this version isn't without issues either, if the person is wearing black, they can sometimes become transparent. I've experimented with changing the saved image to have a purple background instead, seems less likely to get mixed up with the color of clothing, but that leaves people with a purple halo instead. Honestly not sure which version is better
for purple halo-version, it's easy enough to change from
Python:
image = person.build_person_displayable(position, emotion, special_modifier, lighting)
surface = renpy.render_to_surface(image).convert()
Python:
image = person.build_person_displayable(position, emotion, special_modifier, lighting)
newimage = Composite(position_size_dict.get(position),
(0,0), Solid("#ff00ff"),
(0,0),image)
surface = renpy.render_to_surface(newimage).convert()
Python:
image = person.build_person_displayable(position, emotion, special_modifier, lighting)
newimage = Composite(position_size_dict.get(position),
(0,0), Solid(person.get_display_colour_code()),
(0,0),image)
surface = renpy.render_to_surface(newimage).convert()
I really wish I could've gotten rembg to work since that seems to be a more flexible option for background-removal than the what I'm using now, but while rembg worked on it's own, combining it with ADetailer made it break (rembg would always be called first and remove the background and then adetailer would run after that and mess things up by removing the alpha channel and creating a new, wonky-looking, background instead).