Page 1 of 1

Abstract oil paintings

Posted: 2009-09-21T09:32:49-07:00
by JoaCHIP
Just to demonstrate how damn cool ImageMagick is, here's a little crazy demo I just did:


Reload for more.

Re: Abstract oil paintings

Posted: 2009-09-22T00:14:08-07:00
by anthony
Very nice. How about an explanation of how it was generated! :-)

Re: Abstract oil paintings

Posted: 2009-10-08T01:55:48-07:00
by JoaCHIP
Of course. Basically I do these steps:

* Create a 2x2 pixel grey background.
* Add rough gaussian noise.
* Scale up to double size (4x4) using interpolation.
* Add more gaussian noise (but not quite as powerful.)
* Scale up to double size (8x8).
* Add even weaker gaussian noise.
* Repeat until it is slightly larger than the desired size.
* Oil paint effect.
* Crop off the outer 5-10% because of artifacts.
* Go into the HSL colorspace (this makes the next few manipulations look more cool.)
* Normalise the "hue" channel so that we get all hues.
* Normalize the "saturation" channel so that we always have both colorful and colorless areas.
* Go back to RGB colorspace.
* Despeckle and then rotate 90 degrees (I can't explain why, but it just looked nice.)

Here's the code:

Code: Select all

convert -size 64x64 xc:#707070  -resize 2x2 -evaluate Gaussian-noise 0.152 -resize 4x4 -evaluate Gaussian-noise 0.123 -resize 8x8 -evaluate Gaussian-noise 0.100 -resize 16x16 -evaluate Gaussian-noise 0.081 -resize 32x32 -evaluate Gaussian-noise 0.065 -resize 64x64 -evaluate Gaussian-noise 0.053 -resize 128x128 -evaluate Gaussian-noise 0.043 -resize 256x256 -evaluate Gaussian-noise 0.035 -paint 10 -crop 239x239+0+0 -colorspace HSL -channel lightness -normalize -channel saturation -normalize -colorspace RGB -despeckle -rotate 90 "abstract.jpg"

Re: Abstract oil paintings

Posted: 2009-10-08T19:34:45-07:00
by anthony
Very interesting effect.

The first step is basically a type of plasma, or perlin noise function

note on the use of -normalize

In the latest IM (and not yet documented) is a new function -auto-level. This is essentially like -normalize but a 'perfect' normalize, without 'histogram binning', or 'clipping' effects. that is it does a -level on the exact maximum and minimum values found in the image.

You may also like to try -auto-gamma which tries to apply a relatively simplistic mid-tone gamma adjustment function. That is it finds the 'mean value' and tries to apply a calculated gamma adjustment that would make any 'mean' color in the image, 50% gray. It works well for general photos that do not have too much dark/light extremes.

Re: Abstract oil paintings

Posted: 2009-10-13T16:00:17-07:00
by JoaCHIP
Hah! Great suggestions. This sort of thing can be tweaked endlessly. I've been asked for a "desktop sized version" a few times too. I might make such a thing, but it would be an "image of the day" sort of thing, in order to not stress the server too much. :wink:

Re: Abstract oil paintings

Posted: 2009-10-13T19:08:55-07:00
by anthony
The 'plasma' generator that is built into IM is also a very specific perlin noise generator (though only with fixed settings). Unfortunately their is a known bug somewhere deep in the algorithm that causes it to generate some top-left to bottom-right diagonal artefacts. Your solution is a nice variant.

See Plasma Random Canvases

You may also like to look at the table of 'randomized background effects' in

Re: Abstract oil paintings

Posted: 2014-07-24T00:25:43-07:00
by rossdv8
It is amazing what can be found on this site. I know this is an old post (5 years ago) and I have absolutely no interest in abtract art, but I couldn't help testing JoaCHIP's method and code.

64x64 was a little small for me, but I found changing a few numbers is all it takes to make it generate whatever size image you want.

Alternatively resizing the output image after it is produced or adding -resize to a final smallish image makes even more interesting effects, particularly in size of what I suppose could be loosely regarded as brush strokes.

The modified code below will output really pretty 1024x768 wallpaper of around 200Kb size. A quick look at this and the original code above will show that there are only three lots of numbers that actually need to be changed. Two really, but I found changing the first -size from 64x64 gave me some interesting stuff. Then the last -resize and finally the -crop.

I have never come across the same output image twice, so it seems it really is abstract in a random sense.

convert -size 192x256 xc:#707070 -resize 4x4 -evaluate Gaussian-noise 0.152 -resize 8x8 -evaluate Gaussian-noise 0.123 -resize 16x16 -evaluate Gaussian-noise 0.100 -resize 32x32 -evaluate Gaussian-noise 0.081 -resize 64x64 -evaluate Gaussian-noise 0.065 -resize 128x128 -evaluate Gaussian-noise 0.053 -resize 256x256 -evaluate Gaussian-noise 0.043 -resize 790x1050 -evaluate Gaussian-noise 0.035 -paint 10 -crop 768x1024+0+0 -colorspace HSL -channel lightness -normalize -channel saturation -normalize -colorspace RGB -despeckle -rotate 90 abstract.jpg

Thanks JoaCHIP, for providing a heap of fun!



Re: Abstract oil paintings

Posted: 2014-07-24T10:44:23-07:00
by fmw42
You may be able to reproduce the same image by adding -seed and keeping the same seed value. But you may want to have different fixed seeds for each different addition of noise.

See ... s.php#seed