Tag Info

New answers tagged

12

This is a similar idea to ybeltukov's, iteratively splitting rectangles into two smaller rectangles. I've used an integer grid to avoid getting small offsets between adjacent blocks, and a weighted random choice to decide whether to split horizontally or vertically or do nothing. The idea is that long thin rectangles should preferentially be split along the ...


24

An extended comment follows. Mondrian, in the late work referenced by the OP and characterized by primary colored rectangles separated by black lines, employes an extraordinarily sophisticated understanding of perception, color, and light. As background to understand what Mondrian does, I recommend The Interaction on Color, by Joseph Albers and Alfred C. ...


17

Here is my attempt to be Piet Mondrian colors = {RGBColor[0.9, 0.9, 0.9], RGBColor[0.05, 0.05, 0.05], RGBColor[0.8, 0.1, 0.1], RGBColor[0.1, 0.1, 0.5], RGBColor[0.9, 0.7, 0.1]}; split = # /. d : Rectangle[{x1_, y1_}, {x2_, y2_}] :> With[{t = RandomReal@BetaDistribution[10, 10], r = Random[]}, Which[ r < 0.3 (x2 - x1)/(y2 - y1), ...


2

Combining Image and Graphics require Image to be converted to Raster which can be made by Show[image]. The second argument of Raster allows to stretch the image to the full plot range area by using Scaled coordinates: image = Image@Map[ColorData["SunsetColors"], Table[(y - x^2 + 1)/2, {y, Reverse@Range[0, 1, 0.02]}, {x, 0, 1, 0.01}], {2}]; pl1 = ...


2

I think that the help clearly indicates that it won't stretch it automatically. And I don't know of any sneaky way of making it do so. But you could write a helper function to stretch it for you: Clear[insetImage]; insetImage[image_Image, pos_, opos_, size : {w_, h_}] := Module[{a, b}, {a, b} = ImageDimensions@image; Inset[ImageResize[image, If[w ...


1

Is the code you posted just a working example? You could get this plot much simpler: DensityPlot[y - x^2, {x, 0, 1}, {y, 0, 1}, ColorFunction -> "SunsetColors", MeshFunctions -> {#3 &}, Mesh -> 9] The alternative is to rescale the image manually. image = Image@ Map[ColorData["SunsetColors"], Table[(y - x^2 + 1)/2, {y, ...


2

For variety, one can do this with ControllerManipulate imgs = Plot[Sin[x + #], {x, 0, 2 Pi}] & /@ Range[0, 2 Pi, Pi/10]; ControllerManipulate[ Show[imgs[[(Pause[0.05]; 1 + Mod[x++, Length@imgs - 0])]]], {x, 0, 1}]


1

I haven't carefully looked over the makeAnimation that is suggested in the comments but it looks like it might be even be more advanced than what you need, it certainly is more advanced that what I had written so here goes a basic version that might help you: animation[frames_, delay_] := Module[{fr = frames}, Dynamic[ Refresh[First[fr = ...


3

I wish to expand the answer by Simon Woods according to my current understanding. The key point is that a BMP file normally does not contain a 2D array of RGB triplets but instead it contains a color table which lists all unique RGB triplets used in the image and assigns to each of them an index. The 2D array encoding the image contains only indices of ...


4

You can obtain an 8-bit BMP by converting the image to an 8-bit representation: Export["test.bmp", Image[image, "Byte"]] Note that Import["test.bmp","ColorSpace"] will still return RGBColor, because an 8-bit BMP is still in the RGB color space (there is a color table which specifies an RGB color for each of the 256 possible pixel values - while it is very ...


4

I was able to isolate the problem with BarLegend in v.10.0.0. Yes, it is clearly a bug. Let us see the how the thin grey lines are implemented: Cases[ ToBoxes[BarLegend[{"DeepSeaColors", {0, 1}}, LegendLayout -> "ReversedColumn"]], _LineBox, Infinity] {LineBox[ NCache[{{-(15/2), 225/2}, {15/2, 225/2}, {15/ 2, -(225/2)}, {-(15/2), ...



Top 50 recent answers are included