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
Turning Still image into animation (frames) Roll ?
Turning Still image into animation (frames) Roll ?
Last edited by Rye on 2017-01-28T16:15:03-07:00, edited 1 time in total.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Turning Still image into animation (frames) ?
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?
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) ?
Windows.
That sounds interesting.
Are there examples on how to use roll and crop ?
Also, is it possible to change the scrolling direction ?
That sounds interesting.
Are there examples on how to use roll and crop ?
Also, is it possible to change the scrolling direction ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Turning Still image into animation (frames) ?
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.
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.
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
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) ?
Would a cygwin evironment / linux wrapper make these commands work under windows perhaps ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Turning Still image into animation (frames) ?
Yes, it should. But perhaps some Windows IM user can provide the equivalent bat script in native Windows.Rye wrote:Would a cygwin evironment / linux wrapper make these commands work under windows perhaps ?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Turning Still image into animation (frames) ?
For this, I would use "-distort SRT". See my page "Animation with SRT", which includes examples for Windows BAT.
snibgo's IM pages: im.snibgo.com
Re: Turning Still image into animation (frames) ?
@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 ?
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 ?
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Turning Still image into animation (frames) ?
"Yes" to all your questions. The commands with the green backgrounds, run as a Windows BAT script, made the images shown.
If you post your source image and exact commands, we may be able to suggest something.Rye wrote:I tried the samples out...
But failed to produce anything more than a simple copy of my source image.
snibgo's IM pages: im.snibgo.com
Re: Turning Still image into animation (frames) ?
Has been a long time, but at long last I found an approch that works in windows:
It's a bit laughable, but feel free to use it in any way you like xD.
This thread can now be closed.
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.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC