PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

GD Colorize/Multiply questions

I've been playing with GD's colorize and multiply features and came up with a couple of questions:

1. Is it possible to "pre" colorize or "pre" multiply a surface so that I can increase the performance if I were to blit a full screen image instead of it being colorized/multiplied every pass? I'm trying to blit a full screen image and colorize it, however the FPS went down to only 18-20.

2. Is it possible to colorize or apply multiply to a part of an image only? I'm thinking of "colorizing" parts of an image to change its appearance in real time?

Thanks in advance!
egarayblas wrote:
1. Is it possible to "pre" colorize or "pre" multiply a surface so that I can increase the performance if I were to blit a full screen image instead of it being colorized/multiplied every pass? I'm trying to blit a full screen image and colorize it, however the FPS went down to only 18-20.


You can colorize a surface one time, and "save" it to another surface for later usage.

egarayblas wrote:
2. Is it possible to colorize or apply multiply to a part of an image only? I'm thinking of "colorizing" parts of an image to change its appearance in real time?


The only way to do this is colorize to another surface, then blt the colorized portion back. You can't colorize just a portion of a surface. That might be a nice feature to have though - colorize a source RECT of a surface.
Thanks GR!

How can I do a one time colorize and save it to a separate surface? Can I do this using GD v2.04?

Yeah I agree, a nice feature would be a "colorwash" effect. I just change the color of a part of an image to anything gray (R = G = B) and then specify the color to wash it on. I hope VI considers this in a future version. :)

- Erick
egarayblas wrote:How can I do a one time colorize and save it to a separate surface? Can I do this using GD v2.04?


Create a surface the size of your image, then Blt to that surface using the colorizing parameters. Now you'll have the original image and a colorized version that you can blt to the backbuffer at any time.

egarayblas wrote:Yeah I agree, a nice feature would be a "colorwash" effect. I just change the color of a part of an image to anything gray (R = G = B) and then specify the color to wash it on. I hope VI considers this in a future version. :)


I think I'll start a 'wish-list' thread for GD3.x