Mathematica Asked on February 24, 2021
I’m generating a random texture using the code above, by blurring random tiles:
randomTiles =
Table[{RandomReal[], RandomReal[], RandomInteger[{1, 2}]}, {n, 1,
1500}];
Sharpen[Blur[ListDensityPlot[
randomTiles,
ColorFunction -> "IslandColors",
InterpolationOrder -> 0,
Frame -> False,
ImageSize -> {500, 500}
], 10], 2]
Preview of what this code is doing:
Currently, the Blur
is also changing the sides of the picture, and the Sharpen
isn’t doing what I need. So here’s what I would like to achieve:
Transforming the image without any blur or other effects to the sides, which need to stay sharp. Cropping the picture should be avoided, if possible.
Transforming the blurred texture to a very sharpened and contrasting texture, with smooth edges everywhere, so I get two color regions only without any gradient.
How can I do this?
PlotRangePadding
to deal with edges, Binarize
to unblur, and then Colorize
to get your colors back
Colorize[Binarize[
Blur[ListDensityPlot[randomTiles, ColorFunction -> "IslandColors",
InterpolationOrder -> 0, Frame -> False, PlotRangePadding -> 0,
ImageSize -> {500, 500}], 10], .6 ],
ColorRules -> {0 -> Orange, 1 -> Green}]
Correct answer by Rudy Potter on February 24, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP