Colorizing an image?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Colorizing an image?

Post by tentus » Thu Jan 26, 2012 7:41 pm

kikito wrote:
tentus wrote:Keep in mind this is being used in my Raycasting engine and I'd have to apply this effect to every single quad and sprite being drawn on screen
Then my solution clearly doesn't work for you. My assumption was that you would be able to precalculate the colorized versions in advance.
Wow, I'm on a nitpick run, but... I'm pretty sure Jasoco said that, not me.
Kurosuke needs beta testers

User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Colorizing an image?

Post by bmelts » Thu Jan 26, 2012 7:41 pm

Coming soon to an 0.8.0 near you.
Image

coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Colorizing an image?

Post by coffee » Thu Jan 26, 2012 7:48 pm

anjo wrote:Coming soon to an 0.8.0 near you.
Oh that's sweet Anjo, LOVE core support. If I didn't saw a OSX window I would say you wanted to say "Coming soon to an 0.8.0 PC near you." ;D
What blending modes you planning introduce?

User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Colorizing an image?

Post by Kadoba » Thu Jan 26, 2012 7:52 pm

Jasoco wrote:Right now I can darken an image. But that's it. It makes it work with depth in dark areas, but what about white fog or really cool lighting effects. Green for slime. Red for fire or hot areas. Make it fade between red and black for alarms. Shame.
If you need everything on the screen to be one uniform color couldn't you just draw a semi-transparent rectangle over everything?

coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Colorizing an image?

Post by coffee » Thu Jan 26, 2012 7:58 pm

Kadoba wrote:
Jasoco wrote:Right now I can darken an image. But that's it. It makes it work with depth in dark areas, but what about white fog or really cool lighting effects. Green for slime. Red for fire or hot areas. Make it fade between red and black for alarms. Shame.
If you need everything on the screen to be one uniform color couldn't you just draw a semi-transparent rectangle over everything?
I do something like that to colorize a large amount of fast moving grey & color rectangles . But isn't very color accurate.

EDITED: Your concept applied here Kadoba. In the first screen with a huge red rectangle over gray. In second only with GUI layer rectangle over misc colored tiles.
2.png
3.png

User avatar
slime
Solid Snayke
Posts: 2836
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Colorizing an image?

Post by slime » Thu Jan 26, 2012 8:23 pm

The new blend mode, as a shader:

Code: Select all

vec4 effect(vec4 color, Image texture, vec2 texture_coord, vec2 pixel_coord)
{
	vec4 texcolor = Texel(texture, texture_coord);
	vec4 result = vec4(texcolor.rgb + color.rgb - 0.5, texcolor.a);
	return clamp(result, 0.0, 1.0);
}
Last edited by slime on Thu Jan 26, 2012 8:35 pm, edited 1 time in total.

User avatar
Jasoco
Inner party member
Posts: 3642
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Colorizing an image?

Post by Jasoco » Thu Jan 26, 2012 8:32 pm

anjo wrote:Coming soon to an 0.8.0 near you.
Image
Oh joyous day!

coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Colorizing an image?

Post by coffee » Thu Jan 26, 2012 8:43 pm

Jasoco wrote:Oh joyous day!
Didn't you noticed the photoshop fingerprint? ;)

User avatar
Jasoco
Inner party member
Posts: 3642
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Colorizing an image?

Post by Jasoco » Thu Jan 26, 2012 11:47 pm

coffee wrote:
Jasoco wrote:Oh joyous day!
Didn't you noticed the photoshop fingerprint? ;)
Oh shitty day then. Don't get my hopes up. This should be built-in.

User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Colorizing an image?

Post by bmelts » Fri Jan 27, 2012 2:05 am

Jasoco wrote:
coffee wrote:
Jasoco wrote:Oh joyous day!
Didn't you noticed the photoshop fingerprint? ;)
Oh shitty day then. Don't get my hopes up. This should be built-in.
coffee's trolling. It is built in. You can check the commit yourself.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests