Alpha Image outline

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
strayerror
Regular
Posts: 154
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Alpha Image outline

#1 Post by strayerror » Tue Apr 02, 2019 2:19 pm

Hi, not sure if this is possible but I'd like to be able to put a border around an image similar to how it's possible to do with text. However rather than having the border at the image bounds, I'd like to have it follow the edges of the alpha mask.

I had a quick play trying to use the new Blur manipulator, which works a bit, but not really. Am I just missing something obvious?

User avatar
nature1996
Regular
Posts: 62
Joined: Wed Jun 21, 2017 10:35 am
Contact:

Re: Alpha Image outline

#2 Post by nature1996 » Mon May 06, 2019 3:21 pm

Maybe by putting a slightly bigger blacked-out version of the picture behind it? it might not be elegant, but it might do the job.
Je parle aussi français

strayerror
Regular
Posts: 154
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: Alpha Image outline

#3 Post by strayerror » Mon May 06, 2019 10:17 pm

Alas, I tried such an approach and while it gives limited success for images with transparency on the outermost edges, it doesn't work well for images where transparency regions are closer to the centre than opaque regions. The result is more that of a shadow cast from a central light source, so any inner edges don't get the benefit of the outline. :(

Appreciate the suggestion though, it may very well work for others that only require the outer edges be outlined!

User avatar
nature1996
Regular
Posts: 62
Joined: Wed Jun 21, 2017 10:35 am
Contact:

Re: Alpha Image outline

#4 Post by nature1996 » Mon May 06, 2019 10:30 pm

For the inside area, adding a smaller image might complete what missing from the bigger one.
Je parle aussi français

strayerror
Regular
Posts: 154
Joined: Fri Jan 04, 2019 3:44 pm
Contact:

Re: Alpha Image outline

#5 Post by strayerror » Wed May 08, 2019 7:37 am

Oooh, hadn't thought of that!

Gave it a quick try, but unfortunately because the focal point is the centre, the result gives varying results on edges based on how far from the centre they are. For some smaller images the result is OK as the variance is minimal, but for certain other and especially larger images, not so much. Ideally I'm looking to achieve a uniform outline, to that end I tried using offsets (up down left right) but the results aren't great especially at the corners, I could maybe try diagonal offsets too, but then rendering 9 image (8 offsets + the main one) seems like overkill. :(

Post Reply

Who is online

Users browsing this forum: No registered users