• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Getting all image frames from animated .gif files

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, I've basically searched everywhere in trying to find out how to do this.
Can anyone point me in the right direction?
As in, I'm trying to extract all the files from an animated .gif files to .png file while keeping transparency.

EDIT : Nevermind, used C# instead.
 
Sheriff
Posts: 22862
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ImageIO class could have helped you out:
 
Gerald Lam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hm, I've already tried that, but it fits the image to screen.
So if an image is 32x32 but it has a 2px border of transparency,
it'll become 28x28
 
Rob Spoor
Sheriff
Posts: 22862
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Odd. I've tried that with a few images but all resulting images were equally large.
 
Gerald Lam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Weird, I tried it with this picture, but for this one, it doesn't resize tho, it just removes part of the picture.



Also, do you happen to know how to implement animated .gif files into slick?
 
Rob Spoor
Sheriff
Posts: 22862
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gerald Lam wrote:Weird, I tried it with this picture, but for this one, it doesn't resize tho, it just removes part of the picture.


It also happens to me with that image. My guess is that the GIF file was created with only the first image that large. I don't have any GIF editing software installed right now so I can't verify.

Also, do you happen to know how to implement animated .gif files into slick?


Not at all, sorry.
 
Gerald Lam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I made that on photoshop and I'm sure every frame is the same size.
Extracting it with the C# extractor I had works fine, it's just that I'm having problems with this.
I need to do it on java so instead of using tons of images to animate it, I can just use a .gif file.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic