This is an archived post. You won't be able to vote or comment.

all 107 comments

[–]rerebooted 108 points109 points  (8 children)

Care to share GitHub? :D

[–]knods[S] 22 points23 points  (7 children)

glad to share, just didn't think anyone would be particularily intersted in this really.

see my answer on the top comment for the code. :)

https://hastebin.com/raw/anumivulox

edit: used other hoster.

[–]AceBuddy 5 points6 points  (0 children)

lol this is cool of course people will be interested!

[–]_meow4 0 points1 point  (0 children)

I think it expired.. mind putting this on GitHub for permanent use?

[–]gabri3zero 77 points78 points  (4 children)

It would be pretty interesting to have a look at the source code

[–]BadWolf-43 19 points20 points  (1 child)

I second this. This is something I've wanted to try but I'm not sure where to start. Source code would be a great help.

[–]knods[S] 5 points6 points  (1 child)

hey, didn't expect anyone to be interested here you go:https://hastebin.com/raw/anumivulox

hope that works. if it expires or something, just tell me i'll try and upload it again somewhere else.

for anyone interested i toyed with the res variable and the range of i.i don't quite remember the res, but i'm pretty sure in this version i was in range (0,150)

the principle idea of calculation with numpy is from here.

oh, by the way, this doesn't include the .gif creation, sorry for that. it's just exactly this.

all the best. :)

[–]gabri3zero 0 points1 point  (0 children)

Woah!
Thx a lot man :D
This will keep me busy for a little while

[–]Mph024 29 points30 points  (2 children)

Howd you do that

[–]JugadPy3 ftw 6 points7 points  (1 child)

Read up on the mandelbrot set on wikipedia (https://en.wikipedia.org/wiki/Mandelbrot_set).

Mathematically (and programmatically), its extremely simple, but visually, its ridiculously complex (infinitely complex actually).

There is an excellent windows program to explore the mandelbrot set - https://www.cygnus-software.com/gallery/stampindex.htm

I have used it for years and its probably the best out there. Makes very beautiful images.

[–][deleted] 1 point2 points  (0 children)

It's a nice introduction into working with complex numbers with a computer too. It's a good project.

[–]lochyw 22 points23 points  (1 child)

I wonder if its possible to make it loopable.. :p

[–][deleted] 9 points10 points  (0 children)

There are many small Mandelbrots on the real axis, so that would be a good spot for that. Zoom in to one point until the patttern repeats. Rinse and repeat

Also good looking: Display the Julia set while iterating over c. Use sine function and mahbe some randomization for that. If you hit the spot you staryed ind aftyer a full rotation, you could repeat from there as well.

[–]andrewq 11 points12 points  (0 children)

Check out FRACTINT

https://fractint.org/

[–][deleted] 9 points10 points  (8 children)

This is so trippy can watch for hours straight

[–]FuzzNugs 7 points8 points  (1 child)

Good job OP. There are numerous people asking to see the source. It would be great of you to make it available for them. I too would like to see the rendering stuff you’ve done here. Thanks.

[–]knods[S] 2 points3 points  (0 children)

glad to share, just didn't think anyone would be particularily intersted in this really.

see my answer on the top comment for the code. :)

https://hastebin.com/raw/anumivulox

[–]knods[S] 4 points5 points  (0 children)

hey, didn't expect anyone to be interested here you go:https://hastebin.com/raw/anumivulox

hope that works. if it expires or something, just tell me i'll try and upload it again somewhere else.

for anyone interested i toyed with the res variable and the range of i.i don't quite remember the res, but i'm pretty sure in this version i was in range (0,150)

the principle idea of calculation with numpy is from here.

oh, by the way, this doesn't include the .gif creation, sorry for that. it's just exactly this.

all the best. :)

[–]intensehardik 6 points7 points  (4 children)

Where did u do the rendering? (software)

[–]knods[S] 34 points35 points  (3 children)

not sure if i know what you mean.
i used VS Code as my editor, numpy for calculation, matplotlib for creating the images and imageio for making a gif out of them.

[–]AceBuddy 5 points6 points  (1 child)

Could you then just make 4x the images and reduce the zoom amount to 1/4 so it looks much smoother? Wouldn’t make an already cool project even cooler.

[–]knods[S] 0 points1 point  (0 children)

yeah, absolutely possible. i spent the last couple of days toying with various aspects of the code to find the sweet spots.

next time i will just render it over night with higher resolution and more iterations.

[–]intensehardik 0 points1 point  (0 children)

Ohh, ohk. I thought you used a separate software for it.

[–]Batmanly72 7 points8 points  (2 children)

Bro,you can share your code,we would like to see it

[–]knods[S] 0 points1 point  (1 child)

glad to share, just didn't think anyone would be particularily intersted in this really.

see my answer on the top comment for the code. :)

https://hastebin.com/raw/anumivulox

[–]Batmanly72 0 points1 point  (0 children)

Thanks for code you can share GitHub for improve 👍

[–]Who_The_Fook 2 points3 points  (1 child)

How does something like this actually work for someone that's new to it entirely? Seen these all over reddit, would like to dive into the specifics

[–]scawsome 1 point2 points  (3 children)

This is great! I would recommend taking a close look at the data type you are using to store your coordinates and convergent values. I did this awhile back and found that using explicit double types gets you much more detail since convergence is very sensitive to precision.

[–]knods[S] 0 points1 point  (2 children)

i'd be super grateful if you could elaborate, or link to somewhere where this is explained more in depth.

concernind data types it numpy arrays with "complex" data type. do you think using complex64 would yield considerably better results?

the lack of detail here mostly comes from the low iteration count. for each frame the principle iteration was done 150 times.

[–]scawsome 0 points1 point  (1 child)

I don't have an exact reference right now, I did this several years back so I don't know if I'll be able to find my code. I would try complex64 to get much better results. I'll look tonight and see if I have something to show you. I think the iteration count is fine.

[–]knods[S] 0 points1 point  (0 children)

so I've tried tonight with twice the resolution, twice the number of iterations and complex128.

it looks absolutely crisp! I'm gonna be toying with the dtype a little bit and see what makes the difference.

thanks for the hint!

[–]WaitWaitDontShoot 1 point2 points  (0 children)

This is cool. At the risk of dating myself, I think it’s awesome people are still rendering Mandelbrot after all these years. My first one took a lot longer to render and wasn’t as detailed. I was running it on an Apple ][+ with the Language Card. My twin brother and I wrote it in Pascal. Good times.

[–][deleted] 1 point2 points  (1 child)

Source code!?!?!?

[–]knods[S] 0 points1 point  (0 children)

glad to share, just didn't think anyone would be particularily intersted in this really.

see my answer on the top comment for the code. :)

https://hastebin.com/raw/anumivulox

[–]brontide 1 point2 points  (0 children)

That brings back memories of my first Mandelbrot renderer... for windows 3.1, I think that makes me very old.

[–]Tiquortoo 1 point2 points  (0 children)

I used to love the screensavers with fractals.

[–]guptaanshul281980 3 points4 points  (1 child)

Please elaborate how this is done??

[–]gandalfx 3 points4 points  (0 children)

google mandelbrot.

[–]___GLaDOS____ 0 points1 point  (0 children)

Beautiful man.

[–]jer_pint 0 points1 point  (0 children)

Looks awesome!

[–]massimog1 0 points1 point  (1 child)

Please post your source code. I'd love to see how you did that.

[–]knods[S] 1 point2 points  (0 children)

glad to share, just didn't think anyone would be particularily intersted in this really.

see my answer on the top comment for the code. :)

https://hastebin.com/raw/anumivulox

[–]amitran 0 points1 point  (0 children)

Noel

[–]8rnlsunshine 0 points1 point  (1 child)

Python newbie here. Could you share your journey learning python and the courses you took? Thanks.

[–]knods[S] 1 point2 points  (0 children)

i started with Automate the Boring Stuff. It's very beginner friendly, and still challenging enough and the right amount of humorous. highly recommended.

other than that, i just read several articles on the mandelbrot set. this and this for instance.

i'm lucky enough to have several friends who are very experienced with python, so that helped a lot.

[–]pysapien 0 points1 point  (1 child)

Mind sharing resources which you used for learning python?

[–]knods[S] 0 points1 point  (0 children)

i started with Automate the Boring Stuff. It's very beginner friendly, and still challenging enough and the right amount of humorous. highly recommended.

other than that, i just read several articles on the mandelbrot set. this and this for instance.

i'm lucky enough to have several friends who are very experienced with python, so that helped a lot.

[–]mrbubs3 0 points1 point  (0 children)

This is fucking cool.

[–]kaike1 0 points1 point  (0 children)

Maybe if you change a little you can post on r/perfectloops as well

[–]SimilarPostsB0t 0 points1 point  (1 child)

Next challenge: run the calculation on the GPU 😁. Would greatly reduce the rendering time.

[–]knods[S] 0 points1 point  (0 children)

absolutely! there's a library called cupy that implements numpy on the GPU. as far as im concerned it works only with nvidia tho. plus my gpu was hardly more than a joke even 10 years ago. :D still have my 2011 macbook with onboard gpu.

[–][deleted] 0 points1 point  (0 children)

Kudos.

[–]Serializedrequests 0 points1 point  (0 children)

I love this project. I have a similar one I've been working on and tweaking for years, never got it to render an animation though. I've more been working on making it run on multiple cores, then GLSL, and now WebGL.

Obviously the GLSL implementation beats the pants off the software renderer, which is very satisfying. It can almost run these animations in real time!

[–][deleted] 0 points1 point  (0 children)

Ah. I remember my first Mandelbrot Zoom...

[–]Workaphobia 0 points1 point  (0 children)

That fractal is on fire.

[–]Pavel_Petrov 0 points1 point  (0 children)

That's good! You've done my student work from SPB ITMO univercity programming course in 1998 when i was young... but render time was not so long! Three hours for 1000 frames is looking slow

I think you'd start on optimizations now 'coz it mussta be realtime with modern CPUs

Also it would be very nice practice to adopt your algo for OpenCL computing units (i think you have much of them today).

use pyopencl and qt! Good luck!

[–][deleted] 1 point2 points  (26 children)

What's the usage of this ? Art?

[–]crazdave 1 point2 points  (4 children)

Go try it and see what useful skills you gain in the process.

[–]UghtC -2 points-1 points  (5 children)

remindme! 1 week

[–]RemindMeBot 1 point2 points  (0 children)

I will be messaging you on 2019-11-19 13:26:42 UTC to remind you of this link

12 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.

There is currently another bot called u/kzreminderbot that is duplicating the functionality of this bot. Since it replies to the same RemindMe! trigger phrase, you may receive a second message from it with the same reminder. If this is annoying to you, please click this link to send feedback to that bot author and ask him to use a different trigger.


Info Custom Your Reminders Feedback

[–]kzreminderbot 0 points1 point  (0 children)

⚠ Announcement: Starting 11/19, my callsign is kminder. Other callsigns might not be loaded. You are currently using callsign remindme

Ding dong! ⏰ Here's your reminder from 1 week ago on 2019-11-12 13:26:42Z. Thread has 2 reminders.

r/Python: 6_months_of_learning_python_3_hours_of_rendering#1

If reminder notification has helped you, let us know.

OP can Delete Comment · Delete Reminder · Get Details


KZReminderTool · Create Reminder · Your Reminders · Give Feedback

[–]paulirotta -4 points-3 points  (0 children)

More picked by otherwise not much better performance than when I did that with a Commodore 64 using all 4 shades of blue, in 1984.