Suggestion: Greyscale (for dynamic sprites)

Started by TheMagician, Wed 26/04/2006 16:21:21

Previous topic - Next topic

TheMagician

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

Gilbert

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.

GarageGothic

I could certainly use a color/brightness manipulation function for DynamicSprites, and I've even thought about suggesting it myself before.

TheMagician

@Gilbot V7000a:
Wow, that works amazingly well. I think it's perfect for what I need it for. Thanks!

Pumaman

I can see that this would be useful for cool effects -- would anyone else find some sort of DynamicSprite.ConvertToGreyscale function useful?

GarageGothic

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.

SSH

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.
12


G

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.

Khris

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.

TheMagician

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.

Pumaman

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.

Gilbert


G

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.

Pumaman

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.

G


SMF spam blocked by CleanTalk