Results 1 to 4 of 4
- 07-06-2008, 01:10 PM #1
Member
- Join Date
- Jul 2008
- Posts
- 1
- Rep Power
- 0
Extracting jpg from animated gifs
Hi There
I have a problem
I have an animted gif, where i want to extract a jpg from
so i access the gif , and handle each frame as a BufferedImage
so far so good, that works
but if i try to create a jpg from a certain buffered Image
i get a jpg that has completly corrupted colors
It looks very reddish, like there would have been a filter applies to it!
Can anyone help me and tell me where the problem is?:confused:
best wishes
maz
- 05-05-2011, 12:03 PM #2
Member
- Join Date
- Apr 2011
- Location
- Kansas
- Posts
- 26
- Rep Power
- 0
If you wanted to you could just use the animated gif itself in your program. You don't need to convert it to another file type.
- 05-05-2011, 12:15 PM #3
Zombie alert
db
-
You can't load all of an animated gif into a buffered image as BufferedImage only supports static images.
If you actually want to get at the pixel data of the images, then you will need to get the image reader for gif e.g.
Java Code:ImageIO.getImageReadersBySuffix("gif").next()
Then use setInput on it with an ImageInputStream e.g.
Java Code:imageReader.setInput(ImageIO.createImageInputStream(file))
Then use readAll to get an iterator of all the frames:
And finally use getRenderedImage on the IIOImage to get the BufferedImage for that frame.Java Code:for (IIOImage image : imageReader.readAll(null)) { ... }
Similar Threads
-
Animation with Animated GIF
By JavaBean in forum Java 2DReplies: 3Last Post: 06-04-2011, 04:26 PM -
Extracting JAR file
By Java Tip in forum Java TipReplies: 0Last Post: 02-08-2008, 09:17 AM -
Extracting embedded files
By kasturi in forum New To JavaReplies: 0Last Post: 02-07-2008, 12:25 PM -
program help: Extracting words from a string
By toad in forum New To JavaReplies: 1Last Post: 11-04-2007, 06:39 PM -
Extracting data from an XML file...
By techno_brains in forum New To JavaReplies: 1Last Post: 07-15-2007, 05:46 PM


LinkBack URL
About LinkBacks


Bookmarks