News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
idea not yet in progress - gifsicle gui
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: idea not yet in progress - gifsicle gui

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()

02-15-2012 07:11 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
RE: idea not yet in progress - gifsicle gui - mikshaw - 02-15-2012 07:11 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: