Libraryless. Click here for Pure Java version (3400L/24K/80K).
1 | !7 |
2 | |
3 | p { |
4 | new L<File> images; |
5 | for (S id : splitAtSpace("#1003635 #1003670")) |
6 | images.add(loadLibrary(id)); |
7 | |
8 | // makes the parent directory |
9 | File gifFile = prepareProgramFile("animated-speaker.gif"); |
10 | |
11 | // grab the output image type from the first image in the sequence |
12 | BufferedImage firstImage = ImageIO.read(images.get(0)); |
13 | |
14 | // create a new BufferedOutputStream with the last argument |
15 | ImageOutputStream output = fileImageOutputStream(gifFile); |
16 | |
17 | // create a gif sequence with the type of the first image, 500 ms |
18 | // between frames, which loops continuously |
19 | GifSequenceWriter writer = |
20 | new GifSequenceWriter(output, firstImage.getType(), 500, true); |
21 | |
22 | // Write images |
23 | |
24 | writer.writeToSequence(firstImage); |
25 | |
26 | for (int i=1; i < l(images); i++) { |
27 | BufferedImage nextImage = ImageIO.read(images.get(i)); |
28 | writer.writeToSequence(nextImage); |
29 | } |
30 | |
31 | writer.close(); |
32 | |
33 | print("Wrote " + n(l(images), " frame") + " to: " + gifFile.getAbsolutePath()); |
34 | } |
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
ID | Author/Program | Comment | Date |
---|---|---|---|
1250 | stefan | Works! :-) | 2016-07-25 16:50:34 |
Snippet ID: | #1003675 |
Snippet name: | Test GifSequenceWriter |
Eternal ID of this version: | #1003675/4 |
Text MD5: | ba37bd7f7672fa23e9f85fd52663feed |
Transpilation MD5: | ddf429376ddbcfc6f51e6844f0bcd763 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-11-30 13:21:05 |
Source code size: | 1018 bytes / 34 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 887 / 1030 |
Version history: | 3 change(s) |
Referenced in: | [show references] |