Live colour alteration [SOLVED]

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
User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Live colour alteration [SOLVED]

#1 Post by Asceai » Sat Feb 01, 2014 3:51 am

I've been looking through the Ren'Py manual but I've been unable to see any sort of 'live' means of colour transformation of a displayable in ATL or anywhere else (apart from 'Solid'). The matrix stuff is awesome but only being able to use it with image manipulators somewhat limits it.
Is there something I'm missing?
Last edited by Asceai on Sat Feb 01, 2014 8:19 am, edited 1 time in total.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Live colour alteration

#2 Post by xela » Sat Feb 01, 2014 7:12 am

Asceai wrote:I've been looking through the Ren'Py manual but I've been unable to see any sort of 'live' means of colour transformation of a displayable in ATL or anywhere else (apart from 'Solid'). The matrix stuff is awesome but only being able to use it with image manipulators somewhat limits it.
Is there something I'm missing?
How would you use Solid to transform color on a displayable? One of the most powerful tools Ren'Py has is UDD, there you can draw on a canvas using pygame methods directly to renpy. You can create your own displayable that way and can have any color passed as arguments or do it inside the class itself. I don't really know any way to recolor any displayable even with UDD, maybe someone with more skillz in graphics will help us out (cause I wouldn't mind knowing this as well), but I am not entirely sure where I would use it (most displayable in RenPy are created from images anyway).
Like what we're doing? Support us at:
Image

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Live colour alteration

#3 Post by Asceai » Sat Feb 01, 2014 7:56 am

xela wrote:How would you use Solid to transform color on a displayable?
By alphablend-ing it with the displayable. Probably inefficient, definitely limited.

Anyway, with a glance through pygame's documentation as well as of some StackOverflow-etc. questions about similar topics, it looks like pygame actually can't help here - when people asked about doing hue shifts and stuff, they were recommended to directly modify the image pixel-by-pixel. Not something I'd want to do in real-time, especially when it's something the video card could do much more efficiently (even with fixed-function opengl)
I guess this sort of makes sense, since pygame is IIRC just a thin wrapper on SDL and hence not designed to do this sort of thing.

Oh well!

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Live colour alteration

#4 Post by Unin » Sat Feb 01, 2014 8:14 am

I would split the image into a red, green, and blue filtered image using photoshop. then overlay/blend the 3 sprites and adjust their alpha independently.

not sure if it would work in renpy, but thats how they process astronomical and meteorological images.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Live colour alteration

#5 Post by xela » Sat Feb 01, 2014 8:16 am

I still haven't tried messing with AlphaBlending :( so my understanding of what it does is somewhat limited...
Like what we're doing? Support us at:
Image

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Live colour alteration

#6 Post by Asceai » Sat Feb 01, 2014 8:18 am

Unin wrote:I would split the image into a red, green, and blue filtered image using photoshop. then overlay/blend the 3 sprites and adjust their alpha independently.

not sure if it would work in renpy, but thats how they process astronomical and meteorological images.
That's a fair point; in fact, I don't need to keep different copies, I can just im.MatrixColor them to produce the r/g/b varieties and Additive Blend them together.
I suspect the additive blend part is necessary though, although this sort of effect would probably be be approaching too expensive for software in the first place so it might make sense to just create a separate, cheaper alternative if additive isn't supported.
Last edited by Asceai on Sat Feb 01, 2014 8:22 am, edited 1 time in total.

Unin
Regular
Posts: 54
Joined: Wed Sep 01, 2010 8:08 pm
Location: Florida
Contact:

Re: Live colour alteration [SOLVED]

#7 Post by Unin » Sat Feb 01, 2014 8:21 am

let us know how it works out. alot of people ask about hue shifting and if it works it'd be good to know.

User avatar
PyTom
Ren'Py Creator
Posts: 15392
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Live colour alteration [SOLVED]

#8 Post by PyTom » Mon Feb 03, 2014 1:46 pm

For the record, live color blending is something I've had planned for a while. It will require shaders, which means giving up the software renderer and OpenGL 1.4 paths. That's something I'm planning on doing, but there are a few things that I consider to be higher priority at the moment.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot]