FreeImage Module Library?

Blitz3D Forums/Blitz3D Programming/FreeImage Module Library?

System4 Studios(Posted 2008) [#1]
Are there any FreeImage Module Libraries I can use for Blitz3D, because I need it so I can use animated .gifs in my game.



Thanks.


System4 Studios(Posted 2008) [#2]
Nvm... Found it myself..

http://www.blitzbasic.com/codearcs/codearcs.php?code=1732

Thanks anyway..


markcw(Posted 2008) [#3]
This is better for gifs.
http://www.blitzbasic.com/codearcs/codearcs.php?code=2207


System4 Studios(Posted 2008) [#4]
Yo.. Mark.. how would I go about Masking Images under it?

I tried MaskImage command.. but it seems like the black area still isn't gone.





markcw(Posted 2008) [#5]
I don't follow you, are you using gifload or freeimage? Usually transparency/masking data is stored in the gif file so that's supposed to be done for you. Maybe if you upload or mail me the gif file I can have a look at it.


System4 Studios(Posted 2008) [#6]
I'm using GifLoad..


Here is the image I was trying to use.. How do I make it transparent in my little game demo..




_33(Posted 2008) [#7]
You need to set BLACK as your transparent background color before you save the GIF.


System4 Studios(Posted 2008) [#8]
Aight thanks.. I was talking to a friend about this.. He said that I have to remove the black using Imageready. So I'll test A.S.A.P


No Luck: This is what happens when you set the black transparent..




markcw(Posted 2008) [#9]
Ok, I'm afraid I can't remember exactly how you save transparency properly to gif files but I know it's a very fiddly thing that you have to get just right so you should read up on how to save gifs with transparency, here's an example.
http://www.webreference.com/content/studio/disposal.html

The problem with your gifs is that they don't have transparency set properly. I tried myself but as I said I can't remember.

I know you can ignore the background color index as that is ignored in the gifload code as it is an 87a feature. You can just use 0,0,0 for the background color as that is the default transparent color for images in Blitz. If the gif file has a transparent color that color won't be draw by the gifload code.

MaskImage let's you change the transparent color for an image so in your two gifs you can use MaskImage image,8,8,8 for the black one, not sure why it's not 0,0,0 and for the cream one it's MaskImage image,248,248,200. You can use an image editor to get the rgb color of the background color (not to be confused with the background color index).

The disposal methods are tricky, gifs are stream-based so each frame draws over the last one. The first 2 disposals do this, they just render the next frame and leave the rest of the image alone. The next disposal copies the background color which in the gifload code means an empty/black image, not the background color index. The last disposal copies the previous frame over.

Anyway, hope that helps.


System4 Studios(Posted 2008) [#10]
Aight thanks.. I'll just using those masking numbers you gave me.. Might not look perfect, but oh well.. Everything is not perfect.. :)


Thanks..