Solarus-Games English Forum

Community => General discussion => Topic started by: MetalZelda on August 06, 2016, 02:21:57 AM

Title: How to make a bitmap to be blend-compatible ?
Post by: MetalZelda on August 06, 2016, 02:21:57 AM
Greets !

So, I was about to implement a light effect (used by wrightmat in his project) and started to make the thing.
Problem is, the old lighting system use a very basic bitmap

(http://i.imgur.com/gmVltnW.png)

Wrightmat's one use this one in addition to his lighting effect

(http://i.imgur.com/QimyGmg.png)

Is there's a way to "revert" the picture, so I get the same effect
I don't know what and how blending picture are computed, and I greatly suck at image editing so any help would be welcome
I'm using GIMP if you're asking.

Thanks
Title: Re: How to make a bitmap to be blend-compatible ?
Post by: wizard_wizzle (aka ZeldaHistorian) on August 06, 2016, 03:47:35 AM
I just created a new image with a transparent background and used a brush to place the large white dot in the middle, which faded into the background.

I don't know the exact option right off the top of my head, but you should be able to convert the black in your first image into the transparent color and that would give an image that you could use for the light effect.
Title: Re: How to make a bitmap to be blend-compatible ?
Post by: ffomega on December 22, 2016, 02:27:54 AM
your lighting affect looks a lot better than using a large overlay that is larger than the screen.  By using a bitmap that is blended on top of a shader cuts down on image size
Title: Re: How to make a bitmap to be blend-compatible ?
Post by: Diarandor on December 22, 2016, 03:46:25 AM
Quote from: MetalZelda on August 06, 2016, 02:21:57 AM
...
Is there's a way to "revert" the picture, so I get the same effect
...
I think that there is no way to do it with several drawables blendered at the same time on the same surface, although it will be possible someday when Christopho adds new functions to modify pixels. So if you want to use that light effect on the hero lamp and also on other torches at the same time, that probably cannot be done yet.

However, if you only want that light effect for the hero lamp, I think you could use the blend mode of type "none" to draw your transparent/semitransparent image above the black overlay; that would replace all the corresponding pixels, including the alpha channel, which should solve the problem in this case.

Quote from: MetalZelda on August 06, 2016, 02:21:57 AM
...
I'm using GIMP if you're asking.
...
I recommend that you use Aseprite, if you have time to learn it. It is much better to create/edit sprites and pixel art. If you are already good enough with gimp, then maybe it is better that you keep using it.
Title: Re: How to make a bitmap to be blend-compatible ?
Post by: MetalZelda on December 23, 2016, 01:01:20 PM
Oh speaking of that I found the solution, using photofiltre, long time ago, you just have to copy the alpha channel and paste it on a new layer ...
I feel dumb now ...