Image compression

BlitzMax Forums/BlitzMax Beginners Area/Image compression

gameshastra(Posted 2007) [#1]
Whether blitzmax supports .mng [ Multiple image Network Graphics ] file format to run an animation or not...? If so plz give me an Example.....

Thank u


tonyg(Posted 2007) [#2]
Natively bmp, jpg, png.
Non-native check bah.FreeImage


gameshastra(Posted 2007) [#3]
Thank u. Is ter any other way to do an animation through a single file ( like GIF ) instead of using number of images to reduce the memory usage.....?. I am using number of images running sequentially to make an animation, but it consumes more memory.


tonyg(Posted 2007) [#4]
Not too sure what you're asking.
You can put all images that make an animation in the same file (same size cells) and load it using LoadAnimImage.
Under the covers this will create seperate frames so, if you mean you want them internally within the same 'image', search for TAnim in these forums for single-surface code.
Finally, if you're asking if there is .gif support then the answer is 'not natively'. Not sure if bah.freeimage can do animated Gifs but you can test. Other than that I am not aware of anything available.


gameshastra(Posted 2007) [#5]
Thank you


gameshastra(Posted 2007) [#6]
can anyone plz tell me what are all the image file formats supported by Blitzmax.... if possible plz explain with example. I want to use mng or apng image files i have already tried with bah.free module, but its not giving proper output. I got some test files with free mod. In that they given examples using jpg and png... not like mng or apng... can u tel anyother way...

Thanks in advance.


Brucey(Posted 2007) [#7]
Officially supported image formats are :
.bmp
.png
.jpg
.tga



tonyg(Posted 2007) [#8]
can anyone plz tell me what are all the image file formats supported by Blitzmax....

From the docs :
Images are pre-rendered chunks of graphics that can be efficiently drawn using a single DrawImage command. Images are typically stored in png, bmp or jpg format, and can be loaded using the LoadImage command.


if possible plz explain with example

Really? OK, here goes :
superstrict
Graphics 800,600
local image:Timage=loadimage("yourimage.png")
while not keyhit(KEY_ESCAPE)
    cls
    drawimage image,0,0
     flip
wend

I want to use mng or apng image files i have already tried with bah.free module, but its not giving proper output.

What happens?
I get a problem where the debuglog message shows "Couldn't Load" when running bah.freeimage test1.bmx with logo.mng (and other mng files).
If this is the problem you get then it looks to be a bug with the freeimage module. Brucey might be along soon.
Having said that I might have done something wrong creating the new bmk.exe but it seemed to run OK.


gameshastra(Posted 2007) [#9]
Thank u brucey. Can i use apng or mng image files for animation in blitz max, if yes how?. Because i want to reduce the memory consumes by number of PNG images running sequentially for animation or we have to use strip animation. If i use stripimages if i want add one more frame in future i have to change whole strip file. is it right?. So shall i try with apng or mng or is there anyother way to solve?


Brucey(Posted 2007) [#10]
It's quite possible that the mng implementation isn't working properly.
If someone would like to mail me (email address in profile) an example .mng, I can investigate further and hopefully come up with a solution.


tonyg(Posted 2007) [#11]
Brucey, there is one call logo.mng in your module.
You can download test suite with images from here


Dreamora(Posted 2007) [#12]
If you hope for an animation format that animates itself like GIF: there isn't

you will always have to code the frame transition in one or the other way.


gameshastra(Posted 2007) [#13]
Brucey are your testing the logo.mng? Please update the results on the board