Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Images to an animation (program needed)  (Read 1681 times)
0 Members and 1 Guest are viewing this topic.
Offline tonberry1

Junior Member





« Posted 2005-05-06 16:36:53 »

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?

-= Life is what you decide it to be - Solid Snake =-
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #1 - Posted 2005-05-06 19:12:59 »

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.

弾幕 ☆ @mahonnaiseblog
Offline tonberry1

Junior Member





« Reply #2 - Posted 2005-05-07 09:33:10 »

Quote
maybe you find em if you search for sprite sheet maker or something like that.

Thx, that lead to lots of (correct) results now that i know what they are called Smiley
Quote
You can of course also just write such a program in java. It's maybe 40 lines of code.

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 Smiley

-= Life is what you decide it to be - Solid Snake =-
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #3 - Posted 2005-05-07 11:17:59 »

> I have no idea how to save images in Java

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

Wink

弾幕 ☆ @mahonnaiseblog
Offline tonberry1

Junior Member





« Reply #4 - Posted 2005-05-07 13:27:17 »

Quote
> I have no idea how to save images in Java
ImageIO.write(outImage, "png", new File("woohoo.png"));

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 Cheesy

-= Life is what you decide it to be - Solid Snake =-
Offline tonberry1

Junior Member





« Reply #5 - Posted 2005-05-07 15:57:03 »

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?

-= Life is what you decide it to be - Solid Snake =-
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #6 - Posted 2005-05-07 16:32:45 »

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.

Time flies like a bird. Fruit flies like a banana.
Offline tonberry1

Junior Member





« Reply #7 - Posted 2005-05-07 16:44:20 »

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

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

and

are made into this



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).

-= Life is what you decide it to be - Solid Snake =-
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #8 - Posted 2005-05-08 03:25:06 »

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 Wink).

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

弾幕 ☆ @mahonnaiseblog
Offline tonberry1

Junior Member





« Reply #9 - Posted 2005-05-10 12:00:24 »

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 Smiley

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

-= Life is what you decide it to be - Solid Snake =-
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline role

Junior Member




Java manmoth is coming!


« Reply #10 - Posted 2005-05-24 03:25:49 »

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

Golden T Game Engine - Java2D/OpenGL Game Engine
Golden T Website | Golden T Forum
Offline tonberry1

Junior Member





« Reply #11 - Posted 2005-06-03 23:55:15 »

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 Smiley

-= Life is what you decide it to be - Solid Snake =-
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (12 views)
2014-07-24 01:59:36

Riven (10 views)
2014-07-23 21:16:32

Riven (11 views)
2014-07-23 21:07:15

Riven (12 views)
2014-07-23 20:56:16

ctomni231 (42 views)
2014-07-18 06:55:21

Zero Volt (38 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (34 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!