Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: TheMagician on Wed 26/04/2006 16:21:21

Title: Suggestion: Greyscale (for dynamic sprites)
Post by: TheMagician on Wed 26/04/2006 16:21:21
Hi everybody.

I have a very special suggestion:
A function to change the colors of a dymanic sprite (created from a normal screenshot) to greyscale.

However I guess I'm pretty much the only one who requests this feature, so any workaround ideas are welcome, too  :)

Thanks in advance,
Stefan
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: Gilbert on Thu 27/04/2006 02:29:40
If it's used as an object or a character, try using the Tint() function and set all 5 parameters to 100, unfortunately that doesn't look very well as colours like (100R, 0G, 0B) would be changed to full white.

I think there're not functions to do this directly to a sprite at the moment.
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: GarageGothic on Thu 27/04/2006 11:26:45
I could certainly use a color/brightness manipulation function for DynamicSprites, and I've even thought about suggesting it myself before.
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: TheMagician on Thu 27/04/2006 15:50:10
@Gilbot V7000a:
Wow, that works amazingly well. I think it's perfect for what I need it for. Thanks!
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: Pumaman on Mon 08/05/2006 20:17:00
I can see that this would be useful for cool effects -- would anyone else find some sort of DynamicSprite.ConvertToGreyscale function useful?
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: GarageGothic on Tue 09/05/2006 12:12:44
Instead of a specific ConvertToGrayscale function, a DynamicSprite.Tint(int red, int green, int blue, int saturation, int luminance) function might be more useful. It would work exactly like the Character.Tint and Object.Tint functions, except the change would be permanent once performed. Calling DynamicSprite.Tint(100, 100, 100, 100, 100) would turn it grayscale.
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: SSH on Wed 10/05/2006 11:01:51
You'd need to be careful about how it handled the transparent colour in a sprite.. presumably the same as the Object.Tint, which ignored the transparent colour.
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: strazer on Sun 14/05/2006 14:16:57
Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=571
Title: Turning the image to grey scale in-game
Post by: G on Sat 06/10/2007 22:30:24
So that's the question.

Is there some way to turn the screen to greys  in-game?
I tried with TintScreen but the more I've got is to turn it to a brown-sepia.

Cheers.
Title: Re: Turning the image to grey scale in-game
Post by: Khris on Sun 07/10/2007 04:45:57
I don't think this can be achieved using a single script command.
One way is to use grey-scale images of all chars, objects and backgrounds, but if the effect is supposed to work in more than one room, that's a whole lot of work.
Title: Re: Turning the image to grey scale in-game
Post by: TheMagician on Sun 07/10/2007 11:05:38
That is difficult.

The only way that I can think of right now is a big workaround, and I think it can't be used in Rep_Exec in every game loop:
You would have to create a dynamic sprite from screenshot (which in itself I think wouldn't work flawlessly in Rep_Exec) and then use this graphic on a fullscreen character. Then do Character.Tint and set all 5 values to "100". That would produce a greyscale version of the background.

As I read through this again I realize it really is very impractical.
Title: Re: Turning the image to grey scale in-game
Post by: Pumaman on Sun 07/10/2007 11:37:46
If it's just one room where you want to do this, create a seperate greyscale version of the room background and import it as a secondary background for the room. Then in theory you can use SetAmbientTint and SetBackgroundFrame to make everything greyscale.
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: Gilbert on Sun 07/10/2007 12:21:10
Topics Merged.
Title: Re: Turning the image to grey scale in-game
Post by: G on Sun 07/10/2007 15:38:22
Quote from: Pumaman on Sun 07/10/2007 11:37:46
If it's just one room where you want to do this, create a seperate greyscale version of the room background and import it as a secondary background for the room. Then in theory you can use SetAmbientTint and SetBackgroundFrame to make everything greyscale.


Yeah, but this is not the case. I'd like to "freeze" the time, representing it by turning the scene to greyscale, and then the narrator talks, when the narrator finishes the scene returns to it original colours.

But I think this is impossible right now.
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: Pumaman on Sun 07/10/2007 16:00:35
You might be able to do this using the new RawDraw features in the AGS 3.0 beta. You could create a dynamic sprite from the room background image, tint it to greyscale, then draw it back onto the background. If you used SetAmbientTint at the same time that should give you a totally greyscale output.
Title: Re: Suggestion: Greyscale (for dynamic sprites)
Post by: G on Sun 07/10/2007 16:33:53
Cool, thanks CJ.