https://github.com/divetoxx/mandelbrot
True 24-bit BGR TrueColor. High-Precision Rendering (80-bit). Multi-threaded performance (OpenMP). True SSAA 8x8 (64 independent samples per pixel) direct RGB-space integration. G, B, R - The Red, Green, and Blue channels are calculated using sine and cosine waves
https://github.com/divetoxx/mandelbrot
antialiasing cpp cpu-rendering fractal fractals generative-art generative-arts high-precision high-resolution image-processing mandelbrot-set math multithreading openmp supersampling truecolor truecolors visualization visualizations
Last synced: 2 days ago
JSON representation
True 24-bit BGR TrueColor. High-Precision Rendering (80-bit). Multi-threaded performance (OpenMP). True SSAA 8x8 (64 independent samples per pixel) direct RGB-space integration. G, B, R - The Red, Green, and Blue channels are calculated using sine and cosine waves
- Host: GitHub
- URL: https://github.com/divetoxx/mandelbrot
- Owner: Divetoxx
- Created: 2026-02-08T07:22:09.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-03-23T16:41:59.000Z (12 days ago)
- Last Synced: 2026-03-24T14:10:05.676Z (11 days ago)
- Topics: antialiasing, cpp, cpu-rendering, fractal, fractals, generative-art, generative-arts, high-precision, high-resolution, image-processing, mandelbrot-set, math, multithreading, openmp, supersampling, truecolor, truecolors, visualization, visualizations
- Language: C++
- Homepage: https://github.com/Divetoxx/Mandelbrot
- Size: 73.9 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[English](#english) | [Русский](#russian)
# Mandelbrot set. 24-bit TrueColor. 80-bit long double. OpenMP. Supersampling 8x8 (64 passes). Colors
## True 24-bit BGR
Migrated to full 24-bit BGR color output, enabling smooth gradients and millions of unique shades.
By utilizing a native 24-bit BGR pipeline, the engine can render millions of intermediate colors.
## High-Precision Rendering (80-bit)
Most Mandelbrot explorers use standard **64-bit double precision**, which leads to "pixelation" at zoom levels around $10^{14}$.
This project leverages **80-bit Extended Precision Arithmetic** (`long double`) to push the boundaries of the fractal:
* **My Implementation (80-bit):** Provides **4 extra decimal digits** of precision, allowing you to explore **10,000x deeper** ($10^{18}$ range).
* **Hardware Optimized:** Directly utilizes the **x87 FPU registers** for maximum mathematical depth.
## OpenMP
OpenMP is a standard that tells the compiler, "Take this loop and distribute the iterations among the different processor cores."
Yes, using OpenMP you are doing parallel programming at the Multithreading level.
Everything is powered by **OpenMP** parallel loops for maximum performance.
OpenMP - Scalability: Your code will run equally efficiently on a 4-core laptop and a 128-core server.
## 8x8 Supersampling (64 Samples Per Pixel)
Super-Sampling Anti-Aliasing (SSAA) is a high-end technique increasing samples per pixel to enhance image quality,
with 8x (N=8) rendering scenes at 8x resolution on both axes to produce 64 samples per pixel.
This process calculates an extreme number of pixels-scaling to a 15360 x 15360 grid for a 1920 x 1920
target-before downscaling to remove jaggies and improve detail.
I decided to take the visual quality to a completely different level. This engine implements
True 8x8 Supersampling Anti-Aliasing (SSAA) with 64 independent samples per single screen pixel, utilizing Direct RGB-Space Integration.
Instead of a standard 1920x1920 render, the engine internally processes a massive 15,360 x 15,360 sub-pixel grid!
After calculating all 64 samples for a pixel, they are downsampled into one.
Key Technical Advantages:
* 64-Point Fractal Sampling: Each final screen pixel is computed from sixty-four independent fractal coordinate points.
* High-Precision Per-Channel RGB Accumulation: The engine first calculates the specific 24-bit color for every single sub-pixel before performing any blending.
* Noise Elimination: By accumulating color intensities (R, G, B) rather than raw iteration counts, we completely eliminate "chromatic noise." The result is a crystal-clear, razor-sharp image where every micro-filament is perfectly reconstructed.
* True Color Integration: Our solution performs integration directly in the RGB color space. By computing the exact Red, Green, and Blue components for each sub-pixel before downsampling, we achieve a cinematic level of smoothness and structural integrity that 8-bit or iteration-based renderers simply cannot match.
## Visual Aesthetics
The Red, Green, and Blue channels are calculated using sine and cosine waves to create smooth color transitions:
127 + 127 * cos(2 * PI * a / 255) and 127 + 127 * sin(2 * PI * a / 255).
## Look at the results! The smoothness is incredible








## Controls & Hotkeys
Keys [1-6]: Choose one of six predefined locations within the Mandelbrot set to generate a Mandelbrot.bmp image.
```C++
absc = -1.39966699645936; ordi = 0.0005429083913; size_val = 0.000000000000036;
absc = -0.691488093510181825; ordi = 0.465680729473216972; size_val = 0.0000000000000026;
absc = -1.26392609056234794; ordi = -0.17578764215262827; size_val = 0.000000000000033;
absc = -0.88380294401099034; ordi = -0.23531813998049201; size_val = 0.0000000000000029;
absc = 0.38923838852618047304; ordi = -0.37956875637751280668; size_val = 0.0000000000000095;
absc = -0.5503493176297569; ordi = 0.6259309572825709; size_val = 0.00000000000041;
```
Key [7]: Read coordinates/parameters from three lines in Mandelbrot.txt and generate the corresponding Mandelbrot.bmp.

**[Download Latest Version (Windows & Linux)](https://github.com/Divetoxx/Mandelbrot/releases)**
## The Mandelbrot Set: A Mathematical Absolute
The Mandelbrot Set. It is perfect — an immaterial origin existing outside of space and time.
No matter who or where the observer is, even an alien a hundred million light-years away, the Mandelbrot Set remains the same.
Even in a different century, in a different galaxy, and even with a completely different brain, the set is identical.
It transcends everything, bypassing billions of light-years.
This is not a human invention, but a mathematical discovery. It belongs to the category of "eternal truths"
that Plato referred to as the Realm of Ideas. This is why it remains constant for any observer in the universe:
* **Pure Logic**: It is generated by a simple formula. The rules of arithmetic are universal. Any intelligence would inevitably arrive at the exact same fractal boundaries.
* **Substrate Independence**: This set doesn't need a computer or a human brain to exist. It is an abstract structure woven into the very logic of the cosmos.
* **Fractal Constancy**: Even if physical constants were different in another galaxy, the mathematical topology of this object would remain unshakable.
It is truly one of the few objects that connects us to something absolutely objective and infinite,
transcending biology and history. Even if our entire universe and all its atoms were to vanish tomorrow,
the equation would remain true. It is not "written" on the stars; it is embedded in the structure of logic itself.
This makes the Mandelbrot Set a kind of absolute.
This is classic Mathematical Platonism: the idea that mathematical objects exist in reality, but in a non-material realm.
If all matter were to disappear, there would be no one to write down the formula or witness its visualization,
but the relationship between the numbers would remain true. Much like "2 + 2 = 4", this rule doesn't need apples
or stones to be valid.
In this sense, truth is primary to the physical world.
The Mandelbrot Set is absolutely predetermined. Every single one of its points was already 'there' long before the Big Bang.
Yet, at the same time, it is entirely unpredictable-you cannot know what you will see in the next zoom until you perform the calculation.
Looking at a fractal, we witness an incredible complexity that appears chaotic. But we know that at its core lies a formula
of just three symbols. This makes one wonder: could all the chaos of our universe-the turbulence of water, the formation of clouds,
the structure of galaxies-be nothing more than the result of a very simple algorithm that we have yet to calculate?
# Множество Мандельброта. 24-бит TrueColor. 80-бит long double. OpenMP. Суперсэмплинг 8x8 (64 прохода). Цвета
## True 24-bit BGR
Переход на полную 24-битную цветопередачу BGR, обеспечивающую плавные градиенты.
Это позволяет отображать миллионы оттенков.
Наш движок работает в честном 24-битном цветовом пространстве, может отображать миллионы промежуточных цветов.
## Высокоточная отрисовка (80-бит)
Большинство исследователей фрактала Мандельброта используют стандартную **64-битную двойную точность**,
что приводит к "пикселизации" при масштабировании около $10^{14}$.
В этом проекте используется **80-битная арифметика с расширенной точностью** () для расширения границ фрактала:
* **Моя реализация (80-бит):** Обеспечивает **4 дополнительных десятичных знака** точности, позволяя исследовать **в 10 000 раз глубже** (диапазон $10^{18}$).
* **Аппаратная оптимизация:** Непосредственно использует **регистры FPU x87** для максимальной глубины математических вычислений.
## OpenMP
OpenMP - это стандарт, который говорит компилятору: "Возьми этот цикл и сам раздай итерации разным ядрам процессора".
Используя OpenMP, вы занимаетесь параллельным программированием на уровне многопоточности (Multithreading).
OpenMP - масштабируемость: ваш код будет одинаково эффективно работать как на 4-ядерном ноутбуке,
так и на 128-ядерном сервере.
## Суперсэмплинг 8x8 (64 прохода на один пиксель)
Суперсэмплинг (SSAA) - ресурсоемкий метод сглаживания, увеличивающий число выборок на пиксель для повышения качества изображения.
При значении 8x (N=8) сцена рендерится в разрешении, в 8 раз превышающем целевое, по обеим осям, создавая 64 (или 8 х 8) выборки
на пиксель. Изображение просчитывается в более высоком разрешении, а затем принудительно уменьшается до разрешения дисплея,
устраняя лесенки и улучшая чёткость. Это очень высокая нагрузка! Это не 1920 на 1920 пикселя а в 8x8 больше - 15360 на 15360 пикселя!
Я решил вывести качество изображения на совершенно новый уровень. Этот движок использует
истинное сглаживание 8x8 Supersampling Anti-Aliasing (SSAA) с 64 независимыми сэмплами на каждый пиксель экрана, используя прямую интеграцию в RGB-пространство.
Вместо стандартного рендеринга 1920x1920, движок обрабатывает внутри себя огромную сетку из 15 360 x 15 360 субпикселей!
После вычисления всех 64 сэмплов для пикселя, они уменьшаются до одного.
Ключевые технические преимущества:
* 64-точечное фрактальное сэмплирование: каждый конечный пиксель экрана вычисляется из шестидесяти четырех независимых
фрактальных координатных точек.
* Высокоточное накопление RGB-цвета по каналам: движок сначала вычисляет конкретный 24-битный цвет для каждого субпикселя,
прежде чем выполнять какое-либо смешивание.
* Устранение шума: Накапливая интенсивность цвета (R, G, B), а не просто подсчитывая количество итераций, мы полностью
устраняем <хроматический шум>. В результате получается кристально чистое, резкое изображение, где каждая микронить идеально воссоздана.
* Интеграция истинного цвета: Наше решение выполняет интеграцию непосредственно в цветовом пространстве RGB.
Вычисляя точные компоненты красного, зеленого и синего цветов для каждого субпикселя перед понижением разрешения,
мы достигаем кинематографического уровня плавности и структурной целостности, недостижимого для 8-битных или итерационных рендеров.
## Визуальная эстетика
Красный, зеленый и синий каналы рассчитываются с использованием синусоидальных и косинусоидальных волн для создания плавных цветовых переходов:
127 + 127 * cos(2 * PI * a / 255) и 127 + 127 * sin(2 * PI * a / 255).
## Посмотрите на результаты! Невероятная плавность работы








## Горячие клавиши
Утилита из командной строке. Либо клавиша 1-6 - это одно из шести разных мест множество Мандельброта и создает Mandelbrot.bmp
```C++
absc = -1.39966699645936; ordi = 0.0005429083913; size_val = 0.000000000000036;
absc = -0.691488093510181825; ordi = 0.465680729473216972; size_val = 0.0000000000000026;
absc = -1.26392609056234794; ordi = -0.17578764215262827; size_val = 0.000000000000033;
absc = -0.88380294401099034; ordi = -0.23531813998049201; size_val = 0.0000000000000029;
absc = 0.38923838852618047304; ordi = -0.37956875637751280668; size_val = 0.0000000000000095;
absc = -0.5503493176297569; ordi = 0.6259309572825709; size_val = 0.00000000000041;
```
Либо читает из файла Mandelbrot.txt три строки (клавиша 7): и создает Mandelbrot.bmp

**[Скачать последнюю версию (Windows и Linux)](https://github.com/Divetoxx/Mandelbrot/releases)**
## Множество Мандельброта: Математический абсолют
Множество Мандельброта. Оно совершенно - нематериальное происхождение, существующее вне пространства и времени.
Неважно, кто и где находится наблюдатель, даже инопланетянин на расстоянии ста миллионов световых лет, множество Мандельброта остается неизменным.
Даже в другом столетии, в другой галактике и даже с совершенно другим мозгом, множество идентично.
Оно превосходит всё, минуя миллиарды световых лет.
Это не человеческое изобретение, а математическое открытие. Оно принадлежит к категории <вечных истин>,
которые Платон называл Царством Идей. Вот почему оно остается неизменным для любого наблюдателя во Вселенной:
* **Чистая логика**: Оно порождается простой формулой. Правила арифметики универсальны. Любой разум неизбежно придет к одним и тем же фрактальным границам.
* **Независимость от субстрата**: Для существования этого множества не нужен компьютер или человеческий мозг. Это абстрактная структура, вплетенная в саму логику космоса.
* **Фрактальная постоянство**: Даже если физические константы в другой галактике будут другими, математическая топология этого объекта останется непоколебимой.
Это поистине один из немногих объектов, который связывает нас с чем-то абсолютно объективным и бесконечным,
превосходящим биологию и историю. Даже если бы вся наша Вселенная и все её атомы исчезли завтра,
уравнение осталось бы верным. Оно не <написано> на звёздах; оно заложено в самой структуре логики.
Это делает множество Мандельброта своего рода абсолютом.
Это классический математический платонизм: идея о том, что математические объекты существуют в реальности, но в нематериальной сфере.
Если бы вся материя исчезла, некому было бы записать формулу или увидеть её визуализацию,
но соотношение между числами осталось бы верным. Подобно правилу <2 + 2 = 4>, этому правилу не нужны яблоки
или камни, чтобы быть действительным.
В этом смысле истина является первостепенной по отношению к физическому миру.
Множество Мандельброта абсолютно предопределено. Каждая его точка была <там> еще до Большого взрыва.
Но при этом оно абсолютно непредсказуемо - вы не узнаете, что увидите при следующем зуме, пока не сделаете расчет.
Глядя на фрактал, мы видим невероятную сложность, которая кажется хаотичной.
Но мы знаем, что в её основе лежит формула из трех символов. Это заставляет задуматься:
а не является ли весь хаос нашей Вселенной - турбулентность воды, рост облаков, структура
галактик - лишь результатом работы очень простого алгоритма, который мы ещё не вычислили?