0

I need to automatically convert to an animated .gif a .png file containing several frames. I know how many frames does each file contain. All images have transparency, but no alpha channel. Frames are sorted vertically, although I guess that won't make any difference. Since I don't have enough reputation it seems I can't upload pics, but you can figure.

Is there any library I can use? I'm pretty new to Java and I'm stuck with this.

Thanks.

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
najko
  • 47
  • 3
  • To whomever downvoted this, I think it's a valid question. All najko needs is to know where to start. He's not asking us to do his homework or anything like that. – Geeky Guy May 08 '13 at 17:22
  • @Renan the problem looks like OP hasn't done enough research on his/her own about this. Voting to close. – Luiggi Mendoza May 08 '13 at 17:26
  • 1
    Sorry about it, I just feel rushed and want to start working on it as soon as possible. I admit I did little research. However I've found from an old thread: http://stackoverflow.com/questions/6967809/writing-an-animated-gif-from-bufferedimages?lq=1 a class that might solve my problem. It's the one suggested by trashgod, down at the comments. I'll look into it and try to do it by myself. – najko May 08 '13 at 17:51
  • After all I managed to get the GIFs properly! Now all I need to know is: what Object Color(r,g,b,a) values equal full alpha transparency? If I set it to Color(0,0,0,0) it works properly for most cases but sometimes sets black color transparent too. Is there any way to avoid this? I can give more details if needed, just ask. – najko May 09 '13 at 15:56

1 Answers1

1

What you actually need to do is to crop the big PNG into several small images (frames), and then build the animated GIF.

Meet ImageMagick.

leonbloy
  • 73,180
  • 20
  • 142
  • 190