Zac Todd
Zac Todd

Reputation: 123

Julia: Converting GIF frames to PNG

I want to be able to convert gif frames to png in using Julia.

I currently have data that has been save to a 4s gif where every frame is the same (which is strange hence why I trying to convert it) and I want to be able to convert it to a png or to be able.

Upvotes: 1

Views: 264

Answers (2)

tholy
tholy

Reputation: 12179

Something like

using FileIO
img = load("somefile.gif")
save("somefile.png", img[:,:,1])

seems likely to work. You'll need the ImageMagick package installed, and ImageIO is recommended but not required for PNG.

Upvotes: 0

Zac Todd
Zac Todd

Reputation: 123

You can use FFMPEG.jl

and run

using FFMPEG

ffmpeg_exe(" -i $gif_path -vsync 0 $png_path")

Upvotes: 1

Related Questions