在Mathematica中,可以使用ResourceFunction调用RandomMandala来生成曼陀罗花。
ResourceFunction["RandomMandala"][] 生成一个曼陀罗图形
SeedRandom[4243]; ResourceFunction["RandomMandala"][]
SeedRandom[342];
Multicolumn[
Table[
ResourceFunction["RandomMandala"][
"RotationalSymmetryOrder" -> RandomChoice[{3, 6, 12}],
"SymmetricSeed" -> RandomChoice[{True, False}], ImageSize -> Tiny],
36
],
6
]
SeedRandom[474];
Multicolumn[
Table[
ResourceFunction["RandomMandala"][
"Radius" -> Reverse[Range[RandomChoice[{3, 4, 5, 6}]]],
"NumberOfSeedElements" -> RandomChoice[{2, 3, 4}],
"RotationalSymmetryOrder" -> RandomChoice[{3, 4, 5, 6, 7}],
ColorFunction -> "DarkRainbow",
"ConnectingFunction" -> FilledCurve@*BezierCurve,
"SymmetricSeed" -> True, FaceForm -> {Opacity[0.7]},
EdgeForm -> {LightBlue, Opacity[1]},
ImageSize -> 150
],
25],
6
]
SeedRandom[6567];
mandalas = Table[ResourceFunction["RandomMandala"][], 36];
mandalaImages =
Map[Image[#, ImageSize -> {400, 400}, ColorSpace -> "Grayscale"] &,
mandalas];
SeedRandom[3488];
directBlendingImages =
Table[RemoveBackground@
ImageAdjust[
Blend[Colorize[#,
ColorFunction ->
RandomChoice[{"IslandColors", "FruitPunchColors",
"AvocadoColors", "Rainbow"}]] & /@
RandomChoice[mandalaImages, 4], RandomReal[1, 4]]], 12];
ImageCollage[directBlendingImages, Background -> White,
ImagePadding -> 3, ImageSize -> 200]