Page 1 of 1

Scrolling a tiling image that repeats

Posted: 2018-09-09T02:18:59-07:00
by LDAsh
"Version: ImageMagick 7.0.7-28 Q16 x64 2018-03-25"
Hi, I'm trying to figure out how to scroll a tiling image, so when I shift/translate it x/y, whatever exceeds the bounds of the image will repeat on the opposite side.
Something like this:-
https://www.parallelcube.com/wp_install ... roll-0.gif

I can't figure it out, so at the moment I am making a matrix of 3x3, using "page" and then cropping the center tile. This works but is likely a workaround and much slower.
Is there a quicker way to do this that doesn't rely on always creating a 3x3 matrix and just retains the original resolution of the image?

Re: Scrolling a tiling image that repeats

Posted: 2018-09-09T02:59:55-07:00
by snibgo
You have linked to an animated gif that doesn't seem related to your question.

I don't understand your method of "making a matrix of 3x3, using "page" and then cropping the center tile". If you showed actual commands, I might understand.

Perhaps "-roll" is what you need. See http://www.imagemagick.org/script/comma ... s.php#roll

Re: Scrolling a tiling image that repeats

Posted: 2018-09-09T03:32:50-07:00
by LDAsh
Thanks, "roll" was exactly what I was looking for!

Now I have a new issue with it, I wanted to do it by a percentage, like 1/8 or 1/16, so 0.125%% or 0.0625%%, but it seems like the command-line doesn't like it for this operation, or doesn't like these kind of percentages. The issue is, I don't know exactly what resolution the file might be (thus what roll "pixels" I should be using) but a percentage would always give me the number of frames I want.

Re: Scrolling a tiling image that repeats

Posted: 2018-09-09T03:59:18-07:00
by snibgo
Percentages work fine with recent versions of IM. For example, with 7.0.7-28:

Code: Select all

magick logo: -roll +50%+0 x.png
Note that 1/8 is 12.5%, not 0.125%. If used in Windows BAT scripts, double the percentage sign.

Re: Scrolling a tiling image that repeats

Posted: 2018-09-09T04:50:55-07:00
by LDAsh
Oh wow, how silly of me. Helps if I get the percentages correct, hey. :P
Thanks snibgo!!!