News: Visit us on facebook
 Welcome, Guest. Please login or register. April 16, 2024, 03:00:16 AM 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length

## The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!

 Pages: [1]   Go Down
 Author Topic: Early success with creating zooms from high-res Mercator maps.  (Read 1883 times) Description: 0 Members and 1 Guest are viewing this topic.
Pauldelbrot
Fractal Senior

Posts: 2592

 « on: November 13, 2012, 06:11:19 AM »

I've been testing an interesting approach to computing deep zoom movies: rather than brute-calculate every single frame (slow!) or even calculate a regularly-spaced series of large keyframes to interpolate, compute a wallpaper-like vertical strip in a coordinate system like i ln(z - P) where P is the target of the zooming. The x coordinate in the strip decreases from 2pi to zero, while the y coordinate increases from ln(min_zoom) to ln(max_zoom). A horizontal row of pixels in the strip corresponds to a circle about the target point, of a radius dependent on the y coordinate of the row via r = e-2πy/w where w is the chunk width. The radii bunch closer together with increasing y, tending asymptotically to 0.

At this point, I have the following components:

• A Mandelbrot-calculation tool rendering chunks of the strip that are roughly ten thousand pixels wide and four thousand high; the exact ratio is that of 2pi to ln 10. The result is that a new chunk adds a factor of ten to the zoom range spanned. This tool uses a new type of solid guessing that is compatible with smoothed iterations: rather than look for solids it looks for a pixel (at a given pass) not contrasting too strongly with its neighbors, but allowing a difference of up to 2 points in whichever of red, green, blue channels differs the most (in an overall 0-255 range). If any channel of the pixel contrasts with any channel of any of its eight neighbors by more than that that block gets subdivided; otherwise the block is painted by linear-interpolating it with its neighbors. A smooth, shallow gradient thus avoids getting subdivided but still comes out looking accurate.
• A tool that can synthesize an image of any in-range magnification centered on P from a directory full of sequentially-numbered chunks. It converts image pixels into the chunk-space coordinates, then breaks y into a quotient and remainder by the height of one chunk to get a chunk number and an intra-chunk y coordinate. This tool also does antialiasing: it can subsample pixels in its output image, transforming them into the chunk coordinates and averaging the colors of the samples found in chunkspace. With a chunk nearly 10,000 pixels wide it can generate sharp, noise-free 1280x720 images -- which can serve as 720p movie frames. The effective AA degree is around 3 in the corners and can be extremely high towards the center; the central region always looks very good. Subsample pixels are subjected to random jitter by as much as the width of a subpixel, giving a fairly uniform distribution of samples within each output pixel.
• A tool that can synthesize an Archimedean spiral wrapping the entire strip around into a coil, so as to cram as much area as possible into an image with dimensions and an aspect ratio more reasonable than ten thousand by ten million (or whatever). Pixels are again subsampled. A 10,000-wide strip should allow a spiral image up to several thousand pixels across that's still decently antialiased.

These have all been tested up to a shallow but arbitrary-precision depth and seem to work. The chunk generator is, for a low-detail image with large regions lacking high-frequency material, about 4x faster with the super-solid-guessing enabled than with it disabled. The speedup amount will obviously drop, eventually to 1x, for higher-detail areas. The frame synthesizer produces beautiful results as long as the chunk resolution is high enough for the desired output resolution and the zoom is in the range spanned by the chunk data. (Go too deep and a black circle appears in the center of the image where the next needed chunk is missing.) And the spiral generator's results look good so far, though its real test won't come until I have chunk data going a lot deeper.

The whole setup is amenable to gradual and incremental extension of a zoom sequence, movie, or etc.; more chunks can be added at any time to extend the chunk data, and then new, deeper frames can be synthesized that needed the new data. The spiral generator's output is a handy way to visualize progress and serves as a "map" of sorts (it can be given the final depth of the zoom sequence and output a spiral that winds in as far as the chunk data exists and then is black, with the outermost part of the spiral not changing as data is added -- the shallowest magnifications remain in the same place while the deeper material extends the spiral inward).

It's also amenable to experimentation: given the color scheme and zoom target point are finalized, the chunk data need not be recalculated to redo a frame at a different magnification, or a spiral with adjusted parameters, or a movie with a changed mapping of time to magnification, or whatever; or any of those at a changed resolution. And it's the chunk data that's expensive to recalculate, of course.

Note also that the frame generator can rotate as well as zoom -- rotation, in fact, just requires replacing x with (x + offset) mod chunk-width just before sampling from the chunk data, and of course having calculated the offset appropriately: chunk-width * rho / 360 if rho is the desired rotation in degrees. (What, not even a pi in there? Of course there's plenty of pi elsewhere -- in calculating x from the pixel's coordinates to begin with, in the chunk generator to convert the x coordinate into a complex number for the Mandelbrot calculations, and there are even pi squareds here and there in the spiral generator. The spiral generator also has the distinction of having a logarithm of a logarithm -- to keep right angles right angled requires the curves of constant y be perpendicular everywhere to the family of Archimedean spirals of some scale factor, and those curves turn out to be described by theta = -ln(k ln r), where r is radial distance from the center of the spiral and k is a scaling factor calculated to fit the right number of windings into the image.)

There may be some images coming soon. (Fans of Mandelbrot Safari, fear not -- most of my CPU power is being thrown at rendering the next, slow image in that sequence, now about 1/3 done, with only a few short interruptions now and again for testing this stuff or adding a chunk to the test input.)
 Logged

tit_toinou
Iterator

Posts: 192

 « Reply #1 on: December 11, 2012, 07:52:35 PM »

I like that idea.
But having a very long image can be awesome : I myself want to print (in A3 so that I can have a cool fractal book) log maps of m-sets so I don't need a spiral..
A little question : is your Spiral a conformal map ?
 Logged

Pauldelbrot
Fractal Senior

Posts: 2592

 « Reply #2 on: December 11, 2012, 09:01:14 PM »

I like that idea.
But having a very long image can be awesome : I myself want to print (in A3 so that I can have a cool fractal book) log maps of m-sets so I don't need a spiral..
A little question : is your Spiral a conformal map ?

Yes, though finding the family of curves everywhere perpendicular to a family of Archimedean spirals was slightly tricky. I defined

$r = ks + a$

$\theta = s$

which is a two-parameter set of Archimedean spirals. Changing a revolves about the center while changing k scales. Holding the latter constant, it's the family of curves from varying the former that needs a perpendicular family. To get that, define

$h = \ln{r}$

Rigid rotations within the coordinate system $h, \theta$ will induce a locally-conformal mapping of the spiral (away from zero, and away from the $\theta$ branch cut which we can move to keep out of our way) because it converts to Cartesian coordinates in a complex plane by the conformal map $e^{h + i\theta}$ and rigid rotations of that coordinate system are conformal maps. In that coordinate system our spirals are given by

$h = \ln{(ks + a)}$

$\theta = s$

A 90-degree rotation in that system occurs if we switch the coordinates and negate one, which gives

$h = s$

$\theta = -\ln{(ks + a)}$

Using the relation $h = \ln{r}$ then gives

$r = e^s$

$\theta = -\ln{(k\ln{r} + a)}$

In mapping into the spiral, the r coordinate ends up having an integer-multiple-of-k component determined by where we are in the winding, plus a transform of the x coordinate of the strip. If we just made $\theta$ the y coordinate of the strip, there'd be a gross distortion since at a radius of r an arc subtending an angle of 1 gives a curve length of r, so y-space would be stretching more and more as we wound outwards. So, given a $\theta$ we have to base y on the integrated curve length out to where we are (ends up meaning $\frac{1}{2}kw^2$ where w is the total winding out from the center, basically the reconstructed value of the parameter s above). The resulting map is still not conformal, though -- it makes a curve of constant y into a segment spanning the width of one winding of the spiral with constant $\theta$. If we plug a = 0 in the above, though, we find that we want the curve $\theta$ = 0 to be transformed to the curve $\theta = -\ln{(k\ln{r})}$, and given the radial symmetry of the situation, we just subtract the RHS of that from $\theta$ before computing y from it to map into the strip data.

The results look undistorted to my eye, and circular/bullseye patterns around a deep minibrot seem to produce crosswise stripes in the spiral that seem to meet the borders of the coiled strip at right angles, so this seems to have worked.
 Logged

makc
Strange Attractor

Posts: 272

 « Reply #3 on: March 05, 2013, 06:18:25 PM »

hey, it is nice to see people coming up with same ideas, means the ideas have some merit, right? Let me just use this opportunity to remind everyone my earlier proof of concept that all of this is perfectly possible and is actually working. Btw, I actually unwrapped some deep zoom videos into log maps back then, but real time zooming those proved to be harder than I initially thought - it does not look so good with radial compression but without radial compression it's just a sequence of frames with no visual relation to each other.
 Logged
tit_toinou
Iterator

Posts: 192

 « Reply #4 on: March 06, 2013, 04:11:46 PM »

@makc : I think what you've done is pretty good and could be more than a pof with a more detailed source image !
I didn't know your last animation, trippy .
 Logged

makc
Strange Attractor

Posts: 272

 « Reply #5 on: March 26, 2013, 07:05:17 PM »

hmm, reading it again I actually missed the spiral part here. I can't reconstruct this in my head from text the thread needs an image!
 Logged
jehovajah
Global Moderator
Fractal Senior

Posts: 2749

May a trochoid in the void bring you peace

 « Reply #6 on: April 01, 2013, 07:50:10 AM »

I too would like to see an image, but neat work guys!
 Logged

May a trochoid of ¥h¶h iteratively entrain your Logos Response transforming into iridescent fractals of orgasmic delight and joy, with kindness, peace and gratitude at all scales within your experience. I beg of you to enrich others as you have been enriched, in vorticose pulsations of extravagance!
 Pages: [1]   Go Down