Creation of folds on a given background

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Manisha
Posts: 5
Joined: 2011-03-10T22:01:02-07:00
Authentication code: 8675308

Creation of folds on a given background

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Creation of folds on a given background

Post by anthony »

Looks like a very thin random image, say 3-4 pixel high, (with some cyclic waves) that has been highly stretched vertically!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creation of folds on a given background

Post 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
Last edited by fmw42 on 2011-03-21T16:58:16-07:00, edited 1 time in total.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Creation of folds on a given background

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creation of folds on a given background

Post by fmw42 »

Yes, I think Anthony is onto the better solution.

Fred
Post Reply