New answers tagged

13

Here's my solution. Change CompilationTarget -> "C" to CompilationTarget -> "WVM" if you don't have a C compiler available. cf = Compile[{{v, _Real}, {kernel, _Real, 2}}, v*kernel, RuntimeAttributes -> {Listable}, Parallelization -> True, CompilationTarget -> "C", RuntimeOptions -> "Speed" ]; shapedPixels[img_, kernel_] ...


12

Another approach: pic = Import@"http://i.stack.imgur.com/qzMGE.jpg" Image @ ArrayFlatten @ Map[ Map[Function[x, x #], DiskMatrix[5], {2}]&, ImageData@ImageResize[pic, {Automatic, 50}], {2} ] I'm not taking care about preserving image size, it is governed by Resize and DiskMatrix size. just put e.g. DiamondMatrix[5] or ...


12

You need to: Rescale the image to a smaller size, ImageResize Extract the pixel values, ImageData Convert the triplets to RGBColor directive, and build a Graphics with appropriately coloured Disks inside. I found MapIndexed convenient for this. Code: img = ExampleData[{"TestImage", "Sailboat"}]; pixels = Transpose@ImageData[ImageResize[img, 50], ...


17

Load image img = Import["http://i.stack.imgur.com/qzMGE.jpg"] ImagePartition and DominantColors Make an array of Disk of the DominantColors in each part of ImagePartition. Rotate[ Graphics@MapIndexed[ {First@DominantColors[#1, 1], Disk[#2, 1/2]} & , ImagePartition[img, 10], {2} ] , -π/2] ImageResize and ImageData But I find the ...


15

ColorFunction and Epilog were around in version 7. However, ColorFunction did get an update in version 9 so I am not certain if this will work in version 7. Animate[ ParametricPlot[circle[t], {t, Max[0, u - .2], u}, PlotRange -> {{-dMax, dMax}, {-dMax, dMax}}, ColorFunction -> Function[{x, y, w}, Opacity[w, Blue]], Frame -> True, Axes ...



Top 50 recent answers are included