Images to an animation (program needed)

This should explain what I need:
http://var.tonberry1.net/animaatio.jpg

The problem is, that I dont have any good program which would be able to do that. MS Paint doesnt support the PNG-translucency and Adobe Photoshop doesnt really give good coordinates for the objects so the character in animation would jump pretty badly in each frame.

So, any suggestions which program would be able to do that? Or has someone of you done that in some other way (i tried just to keep the pictures in different files, but it was a mess after i had tens of pictures)?

And another question, I read a game development book (by david brackeen), which said that there might be hardware accelerated translucent png images in Java 1.5.0, but atleast i couldnt find that from the new features list. So did I just miss it or are we still waiting for that feature?

You can do that in photoshop just fine. All you need are marker pixels and the offset filter. However, it’s alot of zombie work.

There are some tools, which do that kind of thing… maybe you find em if you search for sprite sheet maker or something like that.

You can of course also just write such a program in java. It’s maybe 40 lines of code.

[quote]maybe you find em if you search for sprite sheet maker or something like that.
[/quote]
Thx, that lead to lots of (correct) results now that i know what they are called :slight_smile:

[quote]You can of course also just write such a program in java. It’s maybe 40 lines of code.
[/quote]
I was thinking of that, but since I have no idea how to save images in Java, I figured that there must be an easier way than learning that :slight_smile:

I have no idea how to save images in Java

ImageIO.write(outImage, “png”, new File(“woohoo.png”));

:wink:

[quote]> I have no idea how to save images in Java
ImageIO.write(outImage, “png”, new File(“woohoo.png”));
[/quote]
Hehe, thx. I was going to say that I just found sprite sheets created by people, but there arent mentioned any good programs (which would be able to handle pngs).

But now that I know how to save those, I can create a program to merge the images :smiley:

Actually I came up with a problem.

I was going to create a BufferedImage which would be big enough for the frames, but in BufferedImage constructor there is something strange:

BufferedImage(int width, int height, int imageType)

So what number would be appropriate as an imageType? I’d like to use translucent PNGs.

edit: hehe, problems again (i dont like working with pictures :/). How should I be able to combine 2 BufferedImages? The api isnt too much help. (or do i just miss the “combineThese(BufferedImage bi)” method?

Use one of the constants in the BufferedImage Class.
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/BufferedImage.html#field_summary

You probably want TYPE_INT_ARGB for RGB plus an alpha channel. If you want a 256 colour palettised image (which can have a transparent colour), look at TYPE_BYTE_INDEXED.

Very well. Thanks to both of you. (I figured out that combining part (BufferedImage.getGraphics() and paint to that one) :))

But anyways. The program is here if anyone has any need for the sprite sheeting.

http://var.tonberry1.net/orbRed00.png
and
http://var.tonberry1.net/orbRed01.png

are made into this

http://var.tonberry1.net/orbs.png

And the source:
http://phpfi.com/60734

edit: I guess the imageType isnt right. Atleast those are 24-bit PNG’s so its a bit more than 256 colors. But ill try out what would work (if any).

Ye, the image type isn’t right. Use RGBA or something like that.

You also need to ensure that you keep your alpha. That means that you have to pick a composite mode, which even draws the alpha stuff over the image (that’s something you usually don’t want ;)).

Graphics2D g = (Graphics2D)something.getGraphics();
g.setComposite(AlphaComposite.Src);
//draw here
g.dispose();

I made those changes and this is the result is shown in my previous post.

Tho the code isnt updated, but im pretty confident that if someone needs that class, they know how to repair it :slight_smile:

Thx again to the helpers (especially to oNyx :)).

Eh, combining bitmap??
I made this one long time agooo, too bad I read this thread too late.
Anyway this is mine: Bitmap Combine

Glad that you told about it. GUI-program should be better for programmers who read this in future. How ever, your program didnt find any picture files from my computer for some reason (?), but it doesnt matter much, I have my program which I can adjust easily when I need :slight_smile: