Page 1 of 1

Creation of folds on a given background

Posted: 2011-03-21T05:20:42-07:00
by Manisha
Is it possible to create folds on a given background using imagemagick? Please guide me.

Sample image:
http://img198.imageshack.us/img198/3369 ... cfolds.jpg
Image

Re: Creation of folds on a given background

Posted: 2011-03-21T06:31:52-07:00
by anthony
Looks like a very thin random image, say 3-4 pixel high, (with some cyclic waves) that has been highly stretched vertically!

Re: Creation of folds on a given background

Posted: 2011-03-21T15:30:17-07:00
by fmw42
Manisha wrote:Is it possible to create folds on a given background using imagemagick? Please guide me.

Sample image:
http://img198.imageshack.us/img198/3369 ... cfolds.jpg

can you post your original background image so others can try using it. seems like one should be able to do that with a combination of sine waves and displacement mapping or -compose modulate or -compose multiply.

This is a simple case of two frequencies:

Image

convert tile_water.jpg \
\( -size 128x128 gradient: -rotate 90 -function sinusoid "10" \) \
\( -size 128x128 gradient: -rotate 90 -function sinusoid "7,180,.25" \) \
\( -clone 1 -clone 2 -compose blend -define compose:args=50% -composite \) \
-delete 1,2 -compose modulate -define compose:args=50% -composite \
tile_water_ripples.jpg

Image

PS. A little rotation of one of the gradients might make it look a bit better.


convert tile_water.jpg \
\( -size 128x128 gradient: -rotate 90 -function sinusoid "10" \) \
\( -size 128x128 gradient: -rotate 90 -function sinusoid "7,180,.25" -rotate 5 -crop 128x128+0+0 +repage \) \
\( -clone 1 -clone 2 -compose blend -define compose:args=50% -composite \) \
-delete 1,2 -compose modulate -define compose:args=50% -composite \
tile_water_ripples2.jpg


Image

Re: Creation of folds on a given background

Posted: 2011-03-21T16:56:11-07:00
by anthony
Following my idea of using a enlarged random image...

Code: Select all

convert -size 20x2 xc: +noise random -separate -delete 1--1 \
            -filter gaussian -resize 100x100\! +level-colors ,DodgerBlue \
            random_folds.jpg
Generate a 2-pixel wide, long random image. Extract one greyscale channel
and with a highly fuzzy filter enlarge and color it.
Image

It may need some contrast enhancement or other adjustment before the enlargement, but does not seem too bad.

I would however like to know more about the underlying algorithm of the original image.

Re: Creation of folds on a given background

Posted: 2011-03-21T16:59:09-07:00
by fmw42
Yes, I think Anthony is onto the better solution.

Fred