Page 1 of 1
Turning Still image into animation (frames) Roll ?
Posted: 2016-01-02T15:16:09-07:00
by Rye
So... I got a rather... unique idea here...
Even though I'm not even sure if Imagemagick is my tool of choice for what I have planned I'll ask anyways.
To make it simple:
I want to go from this:
to this:
Obviously I want to extract frames from a big image and play em, (animated gif) so it appears as if the image is "scrolling" across the screen.
I was thinking if a slice approach with offset and bleed might work here.
Any ideas are welcome.
Would be especially dandy if it were possible to determine the scrolling direction and resulting frame's size.
Thanx in advance.
- Rye
Re: Turning Still image into animation (frames) ?
Posted: 2016-01-02T15:20:10-07:00
by fmw42
You can do that in a loop with successive use of -roll and -crop.
See
http://www.imagemagick.org/script/comma ... s.php#roll
http://www.imagemagick.org/Usage/warping/#roll
http://www.imagemagick.org/Usage/crop/#crop
What platform are you on, since scripting and IM syntax is different on Windows and Unix systems?
Re: Turning Still image into animation (frames) ?
Posted: 2016-01-02T15:30:31-07:00
by Rye
Windows.
That sounds interesting.
Are there examples on how to use roll and crop ?
Also, is it possible to change the scrolling direction ?
Re: Turning Still image into animation (frames) ?
Posted: 2016-01-02T15:43:27-07:00
by fmw42
Read the links I provided above for examples.
In unix, it can be done as follows using subshell processing. The direction is controlled by the incx and incy arguments. Though you can give a direction and increment and convert that to its x and y increments.
Code: Select all
incx=5
incy=5
wd=250
ht=250
numx=`convert xc: -format "%[fx:$wd/$incx]" info:`
numy=`convert xc: -format "%[fx:$wd/$incx]" info:`
num=`convert xc: -format "%[fx:max($numx,$numy)]" info:`
echo "num=$num;"
offx=0
offy=0
(
for ((i=0; i<num; i++)); do
convert still.gif -roll +${offx}+${offy} -gravity center -crop ${wd}x${ht}+0+0 +repage miff:-
offx=$((offx+incx))
offy=$((offy+incy))
done
) | convert -dispose previous -delay 20 - -loop 0 -layers optimize animation.gif
Sorry I do not know how to do this in Windows scripting.
It can also be done by using -distort SRT and just use the oldx,oldy and newx,newy to control the direction. You would also have to provide a viewport crop. See
http://www.imagemagick.org/Usage/distorts/#srt
http://www.imagemagick.org/Usage/distor ... t_viewport
The roll is easier, but only works in full pixel increments. SRT can do fractional pixel shifts.
Re: Turning Still image into animation (frames) ?
Posted: 2016-01-02T16:09:35-07:00
by Rye
Would a cygwin evironment / linux wrapper make these commands work under windows perhaps ?
Re: Turning Still image into animation (frames) ?
Posted: 2016-01-02T17:45:29-07:00
by fmw42
Rye wrote:Would a cygwin evironment / linux wrapper make these commands work under windows perhaps ?
Yes, it should. But perhaps some Windows IM user can provide the equivalent bat script in native Windows.
Re: Turning Still image into animation (frames) ?
Posted: 2016-01-02T18:35:41-07:00
by snibgo
For this, I would use "-distort SRT". See my page "Animation with SRT", which includes examples for Windows BAT.
Re: Turning Still image into animation (frames) ?
Posted: 2016-01-03T13:26:04-07:00
by Rye
@snibgo:
I assume you are talking about this site of yours ?:
http://im.snibgo.com/animsrt.htm
I tried the samples out...
But failed to produce anything more than a simple copy of my source image.
I think you wrote them for windows, correct ?
Re: Turning Still image into animation (frames) ?
Posted: 2016-01-03T14:48:13-07:00
by snibgo
"Yes" to all your questions. The commands with the green backgrounds, run as a Windows BAT script, made the images shown.
Rye wrote:I tried the samples out...
But failed to produce anything more than a simple copy of my source image.
If you post your source image and exact commands, we may be able to suggest something.
Re: Turning Still image into animation (frames) ?
Posted: 2017-01-28T16:14:47-07:00
by Rye
Has been a long time, but at long last I found an approch that works in windows:
Code: Select all
@echo off
echo "Press Enter to roll image into rolled dir"
echo "Exit Script to stop processing"
mkdir rolled
:START
set SAVESTAMP=%DATE:/=-%@%TIME::=-%
set SAVESTAMP=%SAVESTAMP: =%
set SAVESTAMP=%SAVESTAMP:,=.%.jpg
for %%x in (*jpg) do convert %%x -roll +15+15 %%x.no
move *.jpg rolled/%savestamp%
for /R %%x in (*.jpg.no) do ren "%%x" *.
goto start
It's a bit laughable, but feel free to use it in any way you like xD.
This thread can now be closed.