Page 1 of 1
smooth image transition and effect?
Posted: 2010-09-24T09:42:21-07:00
by teapear
hello..
i'm new here..
is it possible create transition effect using imagemagick.... ?
for example like flash transition link below
http://activeden.net/item/flash-banner- ... ator/49745
thanks...
Re: smooth image transition and effect?
Posted: 2010-09-24T09:48:57-07:00
by fmw42
As far as I know there are no direct text animation features in IM. You can create text images frame-by-frame and merge them into animations. The best documentation pages will be at:
http://www.imagemagick.org/Usage/text/
http://www.imagemagick.org/Usage/anim_basics/
and for many more IM techniques at
http://www.imagemagick.org/Usage/
Perhaps others know more or have some scripts already to do some of that and they can comment further.
Re: smooth image transition and effect?
Posted: 2010-09-24T10:19:12-07:00
by teapear
hi fmw42..
thanks for your reply...
if someone there can help me create a script.. please contact me... i'll pay...
Re: smooth image transition and effect?
Posted: 2010-09-24T13:25:20-07:00
by lwhistler
Here is a quick script that needs lots of work, but should give you an idea for one way to handle text animation. Basically you create a text overlay and the
composite -geometry values are changed on each loop, maybe 1 or 2 pixels. In this case all jpg's are turned into a movie with mencoder.
image.jpg
text_overlay.gif
This script needs lots of work and is just a quick demo.
overlay.sh
Code: Select all
#!/bin/bash
ANIMATION_SECONDS=10
FRAME_RATE=30
let FRAMES=ANIMATION_SECONDS*FRAME_RATE
for (( c=1; c<=$FRAMES; c++ ))
do
new_name=`printf %06d $c`
composite -geometry +$FRAMES+15 text_overlay.gif one.jpg temp_$new_name.jpg
let FRAMES=FRAMES-2
done
mencoder "mf://temp*.jpg" -mf fps=30 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=16000
rm temp*.jpg
output.avi
http://www.stubby.ca/output.avi
Re: smooth image transition and effect?
Posted: 2010-09-24T13:45:33-07:00
by fmw42
I think the original poster, teapear, needs to be a bit more specific about what transition is desired and with what text. The flash example has 10 or more transitions with different combinations of images and text. Start with something simple.
Re: smooth image transition and effect?
Posted: 2010-09-25T19:21:21-07:00
by teapear
@lwhistler : thanks for yr script... do you have idea to make text movement run more smoothly..
@fmw :
maybe i want to try smooth transition between 2 images first.. and then 1 line text will fly in from left to center..
let say i have 2 background images background1.jpg and background2.jpg
fade in background1.jpg --> 1 line text fly in on background1.jpg -->fade out background1 and text1 --> fade in background2.jpg --> fade out background2.jpg
Re: smooth image transition and effect?
Posted: 2010-09-25T19:29:46-07:00
by lwhistler
teapear wrote:@lwhistler : thanks for yr script... do you have idea to make text movement run more smoothly..
The script is moving the text at 2 pixels for every loop, 1 pixel might be smoother. Change:
let FRAMES=FRAMES-2 to
let FRAMES=FRAMES-1. Also it could be the AVI movie, I notice it plays better on my computer than the uploaded one.
Re: smooth image transition and effect?
Posted: 2010-09-25T20:09:02-07:00
by teapear
lwhistler wrote:teapear wrote:@lwhistler : thanks for yr script... do you have idea to make text movement run more smoothly..
The script is moving the text at 2 pixels for every loop, 1 pixel might be smoother. Change:
let FRAMES=FRAMES-2 to
let FRAMES=FRAMES-1. Also it could be the AVI movie, I notice it plays better on my computer than the uploaded one.
thank you.. if i using number less than 1 pixel. for example -0.7 pixel.. does it will make better effect compare to 1 pixel on movement..
sorry for noob question.. i'm new to animation scripting... seems need high knowledge in mathematics solving skills..
Re: smooth image transition and effect?
Posted: 2010-09-26T18:57:44-07:00
by anthony
Composition only works with integer pixel positions as the pixel 'grid' must line up.
For sub-pixel translations you will have to use -distort General Image Distortion, to generate the sub-pixel (or the whole 'virtual offset') position.
However currently it is a little blurry. However I have a new solution to that which will improve the results no end.
PS: using GIF for the intermediate text image was not a good idea. It is find for the final solution should have used PNG to preserve the anti-aliasing in the text overlay. GIF animations can be generated from that final composed images.
Anti-aliasing is vital for sup-pixel distortions (translations).