How to generate gif in android? - android

How to generate gif frame by frame, base on a canvas?
I'm writing a chess game, and want to generate a gif file from every move by user. Is there any apis provided by sdk?
Thanks.

Unfortunately that is not possible with any built-in function. The SDK does not come with the ImageIO class. You can make use of this animated GIF encoder:
http://www.java2s.com/Code/Java/2D-Graphics-GUI/AnimatedGifEncoder.htm

Related

How to paint on a video frame by frame and save it using flutter?

The goal is to analyse a video frame by frame and apply a painting on each of those frames. Then save the video and be able to play it.
Do you know if such a thing is possible in flutter? I've heard about ffmpeg package but I'm not too sure if that's possible with it.
I would recommend to make this implementation on respective platforms. It will be more performant that way and you can get complete control of the video generation.
on iOS : AVMutableComposition class is the way to go
I don't know about android.

Convert VideoView to Grayscale android java

I would like to know if there is a way to convert video using VideoView from RGB to Gray without using any external library (such as OpenCV).
I didn't found anything about it.
All that I found is to manipulate the video before display him, by using FFMPEG, using OpenCV that I don't need for this project or do manipulation on SurfaceView using OpenGL.
Is there any way to do the manipulation directly on the VideoView?
Update
I found the solution for this problem, by just use this Library

How do you record AR video processed by OpenCV on Android?

I'm creating an Android app that makes use of OpenCV to implement augmented reality. One of the needed features is that it saves the processed video. I can't seem to find any sample code on real-time saving while using OpenCV.
If the above scenario isn't possible, another option is to save the video first and have it post-processed by OpenCV and saved back as a new file. But I can't find any sample code for this either.
Could someone be kind enough to point me to either direction, or give me an alternative? It's ok if the alternative doesn't use OpenCV.
Typical opencv flow is, you receive frames from camera, convert to RGB format, perform matrix operations then return to activity to display in View. You can actually store the modified frames as images somewhere in sdcard and use jcodec to create your mp4 out of your images. See Android make animated video from list of images.

Is there any way to synthesis image in Android native API or using HTML5

I want to build a mobile app with the following function:
Let user choose an image, then we generate a picture base on that picture.
The generated picture has some specified text with specified font.
There is another picture, which may be a PNG file, used as foreground.
Output that generated picture to user's device.
Is there any way to synthesis image in Android API or using HTML5?
I prefered use some Javascript way to do this, so I can easily build the app cross platform, but I don't know whether JS can do that.
For this purpose you can use HTML5 canvas https://developer.mozilla.org/en/Drawing_Graphics_with_Canvas
If you want to code this using Android API you can use Canvas:
http://developer.android.com/reference/android/graphics/Canvas.html
By the way there is a good guide "Displaying Bitmaps Efficiently" http://developer.android.com/training/displaying-bitmaps/index.html

Decompiling animated GIF file within an app

I would like to download a animated GIF file (more specifically, a weather radar loop), decompile it in frames and play the contents via AnimationDrawable.
The latter part and downloading the image is not a problem, but the middle part is puzzling me: how on earth can I extract the separate frames from the GIF within an app?
I found an easy to use GifDecoder that did the trick for me.

Categories

Resources