[Google AI Studio] Time-Saving Cooking No. 40: An App to Convert Animated GIF Format to APNG Format
In "Time-Saving Cooking No. 35," I released an "app to convert from APNG format to animated GIF format." This time, I will perform the reverse conversion.

The reason I felt like making this is that since there are GIF assets in the world, I thought, "I should make it possible to convert them," but more directly, I discovered that the "old Sora" has a "GIF" output function, and I had a slightly mischievous thought that
there might be a way to extract this and make LINE animated stickers
(laughs).

The simplest usage procedure
The name of the app that converts from GIF format to APNG format is "GIF TO APNG PRO."
The simplest usage procedure for the app is as follows. By the way, it is designed so that it does not crash even with long animated GIFs.
1. Startup screen -> Upload GIF file

Once you launch the app, upload the animated GIF data by dragging and dropping it into the dotted frame area labeled "Import Source GIF."
2. Playback & Timeline display

The animated GIF will play immediately. You can stop playback with the "two vertical lines" button. You can go back one frame with the "<" button and advance one frame with the ">" button. You can freely move the frame position with the slider below the timeline.
3. APNG conversion -> Download

When you press the "Generate APNG" button on the right side of the screen, the GIF to APNG conversion will be performed, and when it finishes, a "Download APNG" button will appear. Press the "
Download APNG" button to download the file.
I want to load a different file
When you want to upload another GIF file, please press the "Reset Media" button at the bottom right of the preview screen.

I want to change the background color
You can switch the background to "Transparent," "White," or "Black" using the button at the top right of the preview.

I want to reduce the file size
You can select the number of colors for output in the "Export Quality" menu. While it is a trade-off with quality, the lower options result in smaller file sizes. Usually, you should leave it at the top option, "Lossless (24-bit+alpha)."

How to set the frame range
When you want to extract only a portion of a long animated GIF, set the "Set Start" (start position) and "Set End" (end position) on the timeline. These setting buttons can be used in two places: in "Configuration" and below the timeline, and both work the same way.
There is a white frame in the center of the timeline. Pressing "Set Start" sets the position of the white frame as the start position. Pressing "Set End" sets the position of the white frame as the end position. Excluded frames will be displayed as grayed out.
Set the start position with Set Start

Set the end position with Set End

The range is set by setting the start and end positions

About timeline thumbnails
Please note that for timeline thumbnails, the step count changes depending on the total number of frames.
If the total number of frames is 60 or less:The step is 1, and all frames are displayed as thumbnails.
If the total number of frames is 120:The step is 2, and frames are displayed every 2 frames.
If the total number of frames is 300:The step is 5, and thumbnails are displayed every 5 frames.
In other words, the specification is to "display a maximum of 60 thumbnails in total" according to the length of the video.
Setting and confirming the exact start and end positions
For the exact frame count, please select the frame using the "<" and ">" buttons. Also, please confirm the start and end position settings in "SELECTED RANGE".

Setting the frame range for LINE stickers
Since animated stickers for LINE are limited to a maximum of 20 frames, I have provided "+20f" and "-20f" buttons for easy configuration.
"+20f" button: Selects 20 frames forward from the start position
"-20f" button: Selects 20 frames backward from the end position

Crop mode for cutting out a partial area of the screen
Sometimes you may want to use only a partial area rather than the entire GIF image. Therefore, I have implemented a crop mode (trimming function). To enter crop mode, turn on the "
CROP MODE" switch (the red boxed area in the figure below). Related setting items (the green boxed area in the figure below) will appear below.

Use the following sliders to set the range.
WIDTH: Adjusts the width
HEIGHT: Adjusts the height
OFFSET X: Adjusts the horizontal position
OFFSET Y: Adjusts the vertical position

LINE Stamp Rule Compliance Check
In crop mode, if you also turn on the "LINE FRAME RULE" switch, the LINE stamp rules will be applied. If it does not comply, it will be displayed in red as "Rule Violation", so please adjust it to a state that complies with the rules.

Share URL
Please give it a try.
Summary: The story of how I was able to register a Sora-generated video as a LINE animated stamp
Regarding the original goal of
"Can videos generated with Sora be registered as LINE animated stamps?"
, the conclusion is that I actually succeeded in registering one.
I was able to confirm that by exporting a video generated with Sora as a GIF and converting it to APNG with this app, it can be registered as a LINE animated stamp without any issues.

↓

However, when you actually try it, some realistic hurdles become apparent.
In particular, when extracting 20 frames from an animated GIF, the file size often exceeds 300KB. As it is, it hits LINE's capacity limit and will be rejected during registration.
As for countermeasures,
Reduce the width and height
Reduce the number of colors
Reduce the number of frames
While adjustments like that are necessary, the easiest and most effective method is likely to reduce the number of frames.
In the future, if Sora becomes capable of "generating the same character consistently," there is a strong possibility that the workflow of
Video Generation → GIF Output → APNG Conversion → LINE Animated Sticker Registration
could become a practical production process.
For now, I would like to conclude by noting that we have confirmed it is "technically possible" as a first step.
That is all!
いいなと思ったら応援しよう!
記事なり、プログラムなりが役に立ったと思った方は、
チップの応援よろしくお願いいたします。
次の開発もがんばろうかな、という気になりますのだ (笑)