Author Topic: How to make a bitmap to be blend-compatible ?  (Read 1863 times)

MetalZelda

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
How to make a bitmap to be blend-compatible ?
« 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



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



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

wrightmat

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
Re: How to make a bitmap to be blend-compatible ?
« Reply #1 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.

ffomega

  • Full Member
  • ***
  • Posts: 223
    • View Profile
    • Solarus Resource & Tutorial Site
Re: How to make a bitmap to be blend-compatible ?
« Reply #2 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
My tilesets page can be found here:
http://absolute-hyrule-tutorials.solarus-games.org/

Diarandor

  • Hero Member
  • *****
  • Posts: 1044
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: How to make a bitmap to be blend-compatible ?
« Reply #3 on: December 22, 2016, 03:46:25 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.

...
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.
« Last Edit: December 22, 2016, 03:49:58 am by Diarandor »
“If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you.”

MetalZelda

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
Re: How to make a bitmap to be blend-compatible ?
« Reply #4 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 ...