smooth image transition and effect?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
teapear

smooth image transition and effect?

Post 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...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: smooth image transition and effect?

Post 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.
teapear

Re: smooth image transition and effect?

Post by teapear »

hi fmw42..

thanks for your reply...

if someone there can help me create a script.. please contact me... i'll pay... :D
lwhistler
Posts: 23
Joined: 2010-09-15T15:33:29-07:00
Authentication code: 8675308

Re: smooth image transition and effect?

Post 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
Image

text_overlay.gif
Image

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: smooth image transition and effect?

Post 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.
teapear

Re: smooth image transition and effect?

Post 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
lwhistler
Posts: 23
Joined: 2010-09-15T15:33:29-07:00
Authentication code: 8675308

Re: smooth image transition and effect?

Post 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.
teapear

Re: smooth image transition and effect?

Post 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.. :?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: smooth image transition and effect?

Post 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).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply