You misunderstand me, I was using David Tschumperle’s code, and this is the test for the conjecture:
rep_slavacat_gen_art:
if !$! error "n_imgs>0==F" fi
+f[-1] "const itermax = 100;
S = x + y;
P = x;
S?repeat (itermax,n,
P = (P*y)%S;
!P?break();
):0;
n>=itermax?0:(n+1)"
+f[-2] "itermax = (r=max(x,y);r?max(2,int(log2(r))));
S = x + y;
P = x;
S?repeat(itermax,n,
P = (P*y)%S;
!P?break();
):0;
n>=itermax?0:(n+1)"
+blend[-2,-1] difference gt. 0
If you execute this cli code:
$ size=4098 $size,$size rep_slavacat_gen_art echo {int(log2($size))} if !iM echo Pass! fi
Then, you’ll notice it keeps passing no matter how much you change size. So, I can only conclude my conjecture is correct in case of your ImageMagick code as a bash command or David’s command.
There is also a massive speed of difference compared with const itermax=100;
C:\Windows\System32>gmic size=8192 $size,$size tic rep_slavacat_gen_art toc
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Set local variable 'size=8192'.
[gmic]-0./ Input black image at position 0 (1 image 8192x8192x1x1).
[gmic]-1./ Initialize timer.
[gmic]-1./ Elapsed time: 3.266 s.
[gmic]-1./ Display image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (8192,8192,1,1) [256 Mio of float32].
data = (0,1,1,1,1,1,1,1,1,1,1,1,(...),0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 12, mean = 0.00572254, std = 0.171757, coords_min = (0,0,0,0), coords_max = (8190,2,0,0).
[gmic]-1./ End G'MIC interpreter.
C:\Windows\System32>gmic size=8192 $size,$size tic rep_slavacat_gen_art toc
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Set local variable 'size=8192'.
[gmic]-0./ Input black image at position 0 (1 image 8192x8192x1x1).
[gmic]-1./ Initialize timer.
[gmic]-1./ Elapsed time: 22.926 s.
[gmic]-1./ Display image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (8192,8192,1,1) [256 Mio of float32].
data = (0,1,1,1,1,1,1,1,1,1,1,1,(...),0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 12, mean = 0.00572254, std = 0.171757, coords_min = (0,0,0,0), coords_max = (8190,2,0,0).
[gmic]-1./ End G'MIC interpreter.