Image strips from animated image

BlitzPlus Forums/BlitzPlus Beginners Area/Image strips from animated image

acolite246(Posted 2009) [#1]
Can I create an image strip from an animated image easily?

I have 360 frames per image I want to animate and I really don't want to manually export every frame.

Thanks


Matty(Posted 2009) [#2]
Are you saying you already have all 360 images and wish to 'splice' them together?

I'm not sure I understand what you are after?

It sounds like you are saying you already have 360 frames of animation as images and wish to join them together?

Or have you rotated your 'base' image through 360 degrees inside blitzplus and wish to combine them into a single image?

It's a fairly simple problem to solve, but maybe you could be a little clearer so that we can give the best solution.


David Boudreau(Posted 2009) [#3]
Definitely be careful of having one big long image- I had that type of general approach working on one PC, but then when I tried my program on another, I got all sorts of junk in the image and it didn't draw its contents correctly. After searching the forums, I concluded it was most likely due to Windows not liking an image bigger than the screen width (or height) so I used a different approach.


_PJ_(Posted 2009) [#4]
I am hoping the commandset for BlitzPlus includes GrabImage. This is invaluable.

Blitz doesn't reuquire textures in strips, but can handle blocks too, once it reads the end of the row, it then moves to a next row if one exists. Meanign that 360 frames dont have to be 1 x 360 but could be in a block of 15 x 12 or even 3 blocks of 5 x 4. So if this is to be re-used by Blitz, hopefully, you can do this.

All you would need to do, essentially, is something like this:

Const TotalFrames=360

Function ExportStrip(Texture,FilePath$="",Filename$="Strip")
	TemporaryFrame=CreateImage(TextureWidth(Texture),TextureHeight(Texture))
	Strip=CreateImage(TextureWidth(Texture)*TotalFrames,TextureHeight(Texture))
	For IterFrames=1 To TotalFrames
		SetBuffer TextureBuffer(Texture,Frames)
			GrabImage TemporaryFrame,0,0
		SetBuffer ImageBuffer(Strip)
			DrawImage TemporaryFrame,(IterFrames-1)*TextureWidth(Texture),0
	Next
	SaveBuffer (ImageBuffer(Strip),FilePath$+"\"+Filename$+".bmp")
End Function



acolite246(Posted 2009) [#5]
I might not have phrased it right:

I have an animated PNG and it has 360 frames. I do not want to have to manually export and stitch every single one of those frames into an imagestrip for use with blitzplus.

Is there a program that takes an animated image (from Fireworks) and exports each frame as an image then stitches those frames into an imagestrip usable by Blitz Plus?


Ginger Tea(Posted 2009) [#6]
i know when jsac used to run paintshop pro they had animations shop (pro?) and this had an animated gif to single image one frame high by however many frames

didnt even know png's could be animated
and im assuming all it is is just oodles (or 360 in this case) of images one after the other, its just a case of looking for the 'page break'

if you knew that 'page break' you could could code your own stitcher


_PJ_(Posted 2009) [#7]
Adobe Photoshop (CS2 version at least) has an "Automate" functionality which allows you to script or set a series of commands to be applied say, on loading an image or whatever, working somewhat similar to a macro.


acolite246(Posted 2009) [#8]
I am using Fireworks 4 (old...) and it includes an automate function... however it is limited to repeating what I have done via saving the history.

This limits me because I cannot set a variable so it saves the files as myFile1.png until myFile359.png

AND I have to manually initiate each task, resulting in me clicking run 358 times...

EDIT: sorry if that makes no sense lol


Beaker(Posted 2009) [#9]
It is incredibly simple to write a BlitzPlus tool to do it for you and then save the image out for your game to load. That code from Malice will help, but it needs a search and replace from "Texture" to "Image", and also adapting to make a block instead of a strip.


acolite246(Posted 2009) [#10]
Yeah! I think I found something

http://blitzbasic.com/codearcs/codearcs.php?code=2207

Gif load module

Not only does it load animated GIFs, it is also public domain! WHOO!


Beaker(Posted 2009) [#11]
GIFs suck. I would only use the GIF loader if you really have no other choice, and even then I probably wouldn't.