Murga-Projects Forums

Full Version: idea not yet in progress - gifsicle gui
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So it's been over a month without a new post here, so I thought I'd say hi.

I've been using Gimp and/or Blender to do most of my gif animation, with gifsicle to optimize, and it works alright mostly. But Gimp especially is very limited in its animation abilities, and I've been wanting to include gifsicle as a larger part of the process. Problem is that I don't like using commandline apps for graphics (other than for doing batch processing), so I started thinking about a gui frontend to gifsicle made with murgalua, especially considering there isn't really much available elsewhere. I've found only two gifsicle frontends, both of which are very old, and neither is available in Debian repo.

Anyway...that's all I had to say about it...haven't done any actual work on it, and it will probably be at least a few weeks before I do, but I felt a need to drop something new into the forum.
Not sure if this project is ever going to get off the ground. I recently tried a program called Pencil, and it has gotten me much more interested in developing hand-drawn animations rather than messing around with video clips.

But I now have a related (though much simpler) project to submit for feedback. I always have trouble working out the conversion between frames per second and milliseconds per frame, and it gets really annoying when different applications can't agree on what format to use (or worse, as in the case of Gimp, use fps during animation preview, and mpf when saving an animation).

So I made a little tool to quickly do the conversion for me. You can either use the sliders or type in values. It's not exact, since it rounds the values up to the next integer (and I'm not 100% certain I even have the math right), but it should be suitable for simple things like gif animation.

Code:
#!/usr/bin/env murgaLua

ww = 250
bw = ww/5
bh = 30
wh = bh*4

function fps_to_mpf()
    mpf_val = math.ceil(1/fps_box:value()*1000)
    mpf_box:value(mpf_val)
    mpf_slide:value(mpf_val)
end
function mpf_to_fps()
    fps_val = math.ceil(1000/mpf_box:value())
    fps_box:value(fps_val)
    fps_slide:value(fps_val)
end

win = fltk:Fl_Window(ww, wh, "frames-per-second/milliseconds-per-frame")
fps_box = fltk:Fl_Int_Input(0, 10, bw, bh, "frames per second")
fps_box:align(6)
fps_slide = fltk:Fl_Hor_Slider(bw, 10, bw*4, bh)
fps_slide:minimum(1)
fps_slide:maximum(200)
fps_slide:step(1)
fps_slide:callback(
function()
    fps_box:value(fps_slide:value())
    fps_to_mpf()
end)
fps_box:callback(
function()
    fps_slide:value(fps_box:value())
    fps_to_mpf()
end)

mpf_box = fltk:Fl_Int_Input(0, bh*2, bw, bh, "milliseconds per frame")
mpf_box:align(6)
mpf_slide = fltk:Fl_Hor_Slider(bw, bh*2, bw*4, bh)
mpf_slide:minimum(5)
mpf_slide:maximum(1000)
mpf_slide:step(1)
mpf_slide:callback(
function()
    mpf_box:value(mpf_slide:value())
    mpf_to_fps()
end)
mpf_box:callback(
function()
    mpf_slide:value(mpf_box:value())
    mpf_to_fps()
end)

win:show()
Fl:run()

Reference URL's