Ken Burns Effect Algorithm-Functions

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Ken Burns Effect Algorithm-Functions

Sivakatirswami
I'm about to embark on developing a few Ken Burns Effects for images  
animation.

Looking on the Net and at iPhoto the model is pretty simple:

1) sets starting size and loc
2) set an ending size and loc

then "tween" between the two.  That's all the software does for  
you.. .though "Photo to Movie" (only 49.95) has a lot of other  
interesting options...

Goal here is to dispense with the requirement to have a quicktime  
movie, but simply call up slides, one file at a time.

Ok the panning is easy enough: move from point A to point B in X  
number of ticks (or secs)

the dynamic resizing is trickier... Several years ago I tried this by  
re-setting the width and height of the images increasing size based  
on ratio, it worked but had problems. Scott Raney said this was an  
inefficient method: one should really re-calculate the rect and then  
apply the rect in decreasing  or increasing increments.

Presumably this will be done on a Send In messaging cycle. But then  
if the image is also moving.. the topleft of the rect must also be  
changing.... So panning and zooming together: this makes it a bit  
trickier. One won't know, during the move, exactly where that point  
(topleft) is, to use it to set a new rect.

Ok so, my math is very rusty and I am wondering if someone already  
has this function in their libs.

e.g if the starting rect on the zoom is something like [A] -100,-100,  
500, 300 ( width 600, height 400)  so if you are zooming up only by  
20%  and your final rect is (after panning) [B] 0,0,720,480.. what is  
the math that gets us from A to B? hmmm, easier said than done...  
presumably one *might* dispense with a move command, since each  
interation of a rect declaration could also "move" the image... but  
one pixel motion is jerky... though I've not see that move from point  
A to point B is much smoother.  (I have yet to see Rev move animation  
run as smoothly as other animation... but I maybe need rub my eyes  
and check again...am I the only one that senses Rev's move cmd to be  
a bit "jerky" or is it just my video card?)

Insights?

Thanks
Sivakatirswami





_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Ken Burns Effect Algorithm-Functions

masmit
It maybe a question of setting the moveSpeed - the slower you set it,  
the smoother it tends to be.

Best,

Mark

On 15 May 2006, at 04:16, Sivakatirswami wrote:

> am I the only one that senses Rev's move cmd to be  a bit "jerky"  
> or is it just my video card?

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Ken Burns Effect Algorithm-Functions

Wally Rodriguez
In reply to this post by Sivakatirswami
The Ken Burns effect, as used in other applications, has to be  
calculated on a sub-pixel level so that it does not look jerky, that  
is because some combinations of start point, size and speed could  
yield sizes or motion that can't be rounded to one pixel.

There must be a way to do this smoothly on the mac, since the screen  
saver does it, but I couldn't even start to tell you how.

W.

On May 14, 2006, at 11:16 PM, Sivakatirswami wrote:

>  but one pixel motion is jerky... though I've not see that move  
> from point A to point B is much smoother.  (I have yet to see Rev  
> move animation run as smoothly as other animation... but I maybe  
> need rub my eyes and check again...am I the only one that senses  
> Rev's move cmd to be  a bit "jerky" or is it just my video card?)
>
> Insights?

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Ken Burns Effect Algorithm-Functions

Sivakatirswami
Well, I think I will have to stay with just  moving from point to  
point (panning) and zooming as two separate operations for now...

Since no one is offering any functions I guess this hasn't been done  
before... so... I'll give it a go on my own.

Sivakatirswami


On May 15, 2006, at 1:19 PM, Wally Rodriguez wrote:

> The Ken Burns effect, as used in other applications, has to be  
> calculated on a sub-pixel level so that it does not look jerky,  
> that is because some combinations of start point, size and speed  
> could yield sizes or motion that can't be rounded to one pixel.
>
> There must be a way to do this smoothly on the mac, since the  
> screen saver does it, but I couldn't even start to tell you how.
>
> W.

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

I was a Hypercard and supercard expert

Alvaro Abril - Tecnologia
Dear Sirs.. It´s Revolution a good software for serious development? Some
years ago I was a Developer with Supercard and Hypercard in Macintosh.. do
you think, Revolution is a good program ?

Best wishes, Alvaro Abril, www.alvaroabril.com , Columbian man living in
Guatemala, Tech Manager, www.fantasticguatemala.com


-----Mensaje original-----
De: [hidden email]
[mailto:[hidden email]] En nombre de Sivakatirswami
Enviado el: Martes, 16 de Mayo de 2006 03:46 a.m.
Para: How to use Revolution
Asunto: Re: Ken Burns Effect Algorithm-Functions

Well, I think I will have to stay with just  moving from point to  
point (panning) and zooming as two separate operations for now...

Since no one is offering any functions I guess this hasn't been done  
before... so... I'll give it a go on my own.

Sivakatirswami


On May 15, 2006, at 1:19 PM, Wally Rodriguez wrote:

> The Ken Burns effect, as used in other applications, has to be  
> calculated on a sub-pixel level so that it does not look jerky,  
> that is because some combinations of start point, size and speed  
> could yield sizes or motion that can't be rounded to one pixel.
>
> There must be a way to do this smoothly on the mac, since the  
> screen saver does it, but I couldn't even start to tell you how.
>
> W.

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: I was a Hypercard and supercard expert

xtalkprogrammer
Hi Alavaro,

Sure, Revolution is a great programme, but when do *you* consider a  
programme "good"? :-) Tell us what you expect from a good programme  
and we'll gladly tell you if Revolution has it.

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Salery is the easiest way to get your own web store on-line: http://
www.salery.biz/salery.html



Op 16-mei-2006, om 22:19 heeft Alvaro Abril - Tecnologia het volgende  
geschreven:

> Dear Sirs.. It´s Revolution a good software for serious  
> development? Some
> years ago I was a Developer with Supercard and Hypercard in  
> Macintosh.. do
> you think, Revolution is a good program ?
>
> Best wishes, Alvaro Abril, www.alvaroabril.com , Columbian man  
> living in
> Guatemala, Tech Manager, www.fantasticguatemala.com
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553
Reply | Threaded
Open this post in threaded view
|

Re: I was a Hypercard and supercard expert

Sarah Reichelt-2
In reply to this post by Alvaro Abril - Tecnologia
On 5/17/06, Alvaro Abril - Tecnologia <[hidden email]> wrote:
> Dear Sirs.. It´s Revolution a good software for serious development? Some
> years ago I was a Developer with Supercard and Hypercard in Macintosh.. do
> you think, Revolution is a good program ?
>
> Best wishes, Alvaro Abril, www.alvaroabril.com , Columbian man living in
> Guatemala, Tech Manager, www.fantasticguatemala.com

If you are a HyperCard/SuperCard expert, then you will find Revolution
really easy to use. It has it's own way of doing things, but the basic
concept is the same, with lots more power & capabilities than
HyperCard ever had.

But to answer your question properly, we really need to know what sort
of software development you are contemplating.

Cheers,
Sarah
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

I need to create a background structure (hypercard style)

Alvaro Abril - Tecnologia
Dear Sirs.. I need to create background buttons and fields.. I remember in
Macintosh.. but in Revolution, i dont know how to create background objects.
All my objects are in  the cards....

Thank you, Alvaro Abril, www.fantasticguatemala.com , www.alvaroabril.com

-----Mensaje original-----
De: [hidden email]
[mailto:[hidden email]] En nombre de Sarah Reichelt
Enviado el: Martes, 16 de Mayo de 2006 02:52 p.m.
Para: How to use Revolution
Asunto: Re: I was a Hypercard and supercard expert

On 5/17/06, Alvaro Abril - Tecnologia <[hidden email]> wrote:
> Dear Sirs.. It´s Revolution a good software for serious development? Some
> years ago I was a Developer with Supercard and Hypercard in Macintosh.. do
> you think, Revolution is a good program ?
>
> Best wishes, Alvaro Abril, www.alvaroabril.com , Columbian man living in
> Guatemala, Tech Manager, www.fantasticguatemala.com

If you are a HyperCard/SuperCard expert, then you will find Revolution
really easy to use. It has it's own way of doing things, but the basic
concept is the same, with lots more power & capabilities than
HyperCard ever had.

But to answer your question properly, we really need to know what sort
of software development you are contemplating.

Cheers,
Sarah
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: I need to create a background structure (hypercard style)

Peter T. Evensen
Hola, Alvaro,

You group the items and set the group's background Behavior to true (i.e.,
check it in the property editor).  This will cause them to be placed on new
cards and be in the back of the message path.

You can then use the Place Group... menu item in the Object menu to add
that group to existing cards.

Hope this helps.

At 05:20 PM 5/16/2006, you wrote:

>Dear Sirs.. I need to create background buttons and fields.. I remember in
>Macintosh.. but in Revolution, i dont know how to create background objects.
>All my objects are in  the cards....
>
>Thank you, Alvaro Abril, www.fantasticguatemala.com , www.alvaroabril.com
>
>-----Mensaje original-----
>De: [hidden email]
>[mailto:[hidden email]] En nombre de Sarah Reichelt
>Enviado el: Martes, 16 de Mayo de 2006 02:52 p.m.
>Para: How to use Revolution
>Asunto: Re: I was a Hypercard and supercard expert
>
>On 5/17/06, Alvaro Abril - Tecnologia <[hidden email]> wrote:
> > Dear Sirs.. It´s Revolution a good software for serious development? Some
> > years ago I was a Developer with Supercard and Hypercard in Macintosh.. do
> > you think, Revolution is a good program ?
> >
> > Best wishes, Alvaro Abril, www.alvaroabril.com , Columbian man living in
> > Guatemala, Tech Manager, www.fantasticguatemala.com
>
>If you are a HyperCard/SuperCard expert, then you will find Revolution
>really easy to use. It has it's own way of doing things, but the basic
>concept is the same, with lots more power & capabilities than
>HyperCard ever had.
>
>But to answer your question properly, we really need to know what sort
>of software development you are contemplating.
>
>Cheers,
>Sarah
>_______________________________________________
>use-revolution mailing list
>[hidden email]
>Please visit this url to subscribe, unsubscribe and manage your subscription
>preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>_______________________________________________
>use-revolution mailing list
>[hidden email]
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution

Peter T. Evensen
http://www.PetersRoadToHealth.com
314-629-5248 or 888-682-4588


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: I need to create a background structure (hypercard style)

Dan Shafer-2
Alvaro.....

If you're a HyperCard/SuperCard expert, I'd suggest you stop working on Rev
right now and go to the RunRev Web site and read the two excellent documents
there that help you transition from those environments to Revolution. It
will save you a LOT of time!

Welcome to the Revolution!

http://support.runrev.com/resources/hypercard.php

http://support.runrev.com/resources/supercard.php

Dan Shafer
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Ken Burns Effect Algorithm-Functions

Sivakatirswami
In reply to this post by Wally Rodriguez
OK... this leads to larger, more fundamental questions on video sprit  
still animation of any object, be it pan-zoom photo or just any  
object  moving across the screen:

Since screens are made of pixels, I always thought that a "sub-pixel"  
position was a "vikalpa" (the horn on the hare, the cheese in the  
moon -- a idea that has no basis in reality) But if indeed you are  
correct that the reason e.g. Flash animation is so smooth, is because  
movement is calculated across sub-pixels points, then this means that  
one might try, for example:

set the topleft of image 1 to 1.121,12.675

This just doesn't work in Rev... nothing happens, no error and no  
change in the image loc

As for a zoom function, in Rev. I think we can only address video  
pixels as whole integers and that screen positions really are never  
more than whole integer pixel positions, in any context...

Can anyone improve  on the smoothness of this zoom function, just  
import an image into any stack and add this buttondddddddddddd

local tRatio

on mouseUp
# set up  a reset  for testing purposes
   if the uOriginalSize of img 1 is empty then
      set the uOriginalSize of img 1 to the rect of image 1
   else
    set the rect of image 1 to the uOriginalSize of img 1
   end if

   put the height of image 1/the width  of  image 1 into tRatio
   zoomIn
end mouseUp

on zoomIn
  repeat 50 times
    set the rect of image 1 to (zoomIn(the rect of image 1))
    wait .5 millisecond
  end repeat
# this is not too bad depending on the "continuoustoneness" of the  
jpg.. the more "edges" the more pixelated the zoom appears.

end zoomIn

function zoomIn tRect
  subtract 1 from item 1 of tRect
  subtract 1 from item 2 of tRect
  add 1 to item 3 of tRect
  put ( (item 3 of tRect-item 1 of tRect) * tRatio) + item 2 of tRect  
into item 4 of tRect
  return tRect
end zoomIn


Sivakatirswami







On May 15, 2006, at 1:19 PM, Wally Rodriguez wrote:

> The Ken Burns effect, as used in other applications, has to be  
> calculated on a sub-pixel level so that it does not look jerky,  
> that is because some combinations of start point, size and speed  
> could yield sizes or motion that can't be rounded to one pixel.
>
> There must be a way to do this smoothly on the mac, since the  
> screen saver does it, but I couldn't even start to tell you how.
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Ken Burns Effect Algorithm-Functions

Alex Tweedly
Sivakatirswami wrote:

> OK... this leads to larger, more fundamental questions on video sprit  
> still animation of any object, be it pan-zoom photo or just any  
> object  moving across the screen:
>
> Since screens are made of pixels, I always thought that a "sub-pixel"  
> position was a "vikalpa" (the horn on the hare, the cheese in the  
> moon -- a idea that has no basis in reality) But if indeed you are  
> correct that the reason e.g. Flash animation is so smooth, is because  
> movement is calculated across sub-pixels points, then this means that  
> one might try, for example:
>
> set the topleft of image 1 to 1.121,12.675
>
> This just doesn't work in Rev... nothing happens, no error and no  
> change in the image loc
>

> As for a zoom function, in Rev. I think we can only address video  
> pixels as whole integers and that screen positions really are never  
> more than whole integer pixel positions, in any context...
>
Well, you can set the rect of an image to non-integer values (see your
code below for an example :-)
I'm sure it gets rounded to an integer pixel when rendered - but using
the rect does allow you to avoid handling the rounding yourself.

> Can anyone improve  on the smoothness of this zoom function, just  
> import an image into any stack and add this buttondddddddddddd
>
> on zoomIn
>  repeat 50 times
>    set the rect of image 1 to (zoomIn(the rect of image 1))
>    wait .5 millisecond
>  end repeat
> # this is not too bad depending on the "continuoustoneness" of the  
> jpg.. the more "edges" the more pixelated the zoom appears.
>
I'm not sure there is any value in using a time period below 1
millisecond (in fact, I'm not sure it does).

> end zoomIn
>
> function zoomIn tRect
>  subtract 1 from item 1 of tRect
>  subtract 1 from item 2 of tRect
>  add 1 to item 3 of tRect
>  put ( (item 3 of tRect-item 1 of tRect) * tRatio) + item 2 of tRect  
> into item 4 of tRect
>  return tRect
> end zoomIn
>
This won't work so well for non-square images.
The width increases by 2 on each step, so 100 total, keeping properly
centred.

But for a tall skinny image (say 4 times as high as it is wide), this
means the height goes up by 8 on each step - but the top changes by only
1 pixel, so the bottom moves down by 7.  And conversely for a wide,
shallow image.

For images that are close to square, this "drift" won't be obvious - but
I think it will make the zoom less smooth.

You can avoid that by calculating the revised height, and then centering
that around the height.

function zoomIn tRect
  put tRect into saferect
  subtract 1 from item 1 of tRect
  add 1 to item 3 of tRect
  put ( (item 3 of tRect - item 1 of tRect) * tRatio) / 2 into
tNewHalfHeight
  put (item 2 of tRect + item 4 of tRect) / 2 into tNewCentre
  put tNewCentre - tNewHalfHeight into item 2 of tRect
  put tNewCentre + tNewHalfHeight into item 4 of tRect
  put saferect && tRect & cr after msg
  return tRect
end zoomIn




>
> Sivakatirswami
>
>
>
>
>
>
>
> On May 15, 2006, at 1:19 PM, Wally Rodriguez wrote:
>
>> The Ken Burns effect, as used in other applications, has to be  
>> calculated on a sub-pixel level so that it does not look jerky,  that
>> is because some combinations of start point, size and speed  could
>> yield sizes or motion that can't be rounded to one pixel.
>>
>> There must be a way to do this smoothly on the mac, since the  screen
>> saver does it, but I couldn't even start to tell you how.
>>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>


--
Alex Tweedly       http://www.tweedly.net



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.5.6/340 - Release Date: 15/05/2006

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Ken Burns Effect Algorithm-Functions

Sivakatirswami
Alex... thanks... this is better, yes, but there is still the  
"twinkling" of pixels everywhere as it zooms in... if i open the same  
photo in iMovie and run a Burns effect zoom on it... it is absolutely  
smooth... Actually the "twinkle" effect would be a good for thing for  
children... but pros will sneer at it...

I would be interesting in understanding the fundamental differences  
from the "video physics" between the two technologies.. the Rev  
script is obviously just doing simple geometry...

I wonder how a movie technology differs...

Am I asking too much to try to get the same thing in Revolution?  (I  
expect so...)  My whole endeavor here is to avoid a heavy weight QT  
app for light weight internet delivery.


On May 17, 2006, at 12:59 PM, Alex Tweedly wrote:

> For images that are close to square, this "drift" won't be obvious  
> - but I think it will make the zoom less smooth.
>
> You can avoid that by calculating the revised height, and then  
> centering that around the height.
>
> function zoomIn tRect
>  put tRect into saferect
>  subtract 1 from item 1 of tRect
>  add 1 to item 3 of tRect
>  put ( (item 3 of tRect - item 1 of tRect) * tRatio) / 2 into  
> tNewHalfHeight
>  put (item 2 of tRect + item 4 of tRect) / 2 into tNewCentre
>  put tNewCentre - tNewHalfHeight into item 2 of tRect
>  put tNewCentre + tNewHalfHeight into item 4 of tRect
>  put saferect && tRect & cr after msg
>  return tRect
> end zoomIn

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Ken Burns Effect Algorithm-Functions

Richard Gaskin
In reply to this post by Sivakatirswami
Sivakatirswami wrote:
> Alex... thanks... this is better, yes, but there is still the  
> "twinkling" of pixels everywhere as it zooms in... if i open the same  
> photo in iMovie and run a Burns effect zoom on it... it is absolutely  
> smooth... Actually the "twinkle" effect would be a good for thing for  
> children... but pros will sneer at it...
>
> I would be interesting in understanding the fundamental differences  
> from the "video physics" between the two technologies.. the Rev  
> script is obviously just doing simple geometry...

My hunch: Assembler.

:)

--
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  [hidden email]       http://www.FourthWorld.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution