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
Creation of folds on a given background
- 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
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/
https://imagemagick.org/Usage/
- 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
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:
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
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
Last edited by fmw42 on 2011-03-21T16:58:16-07:00, edited 1 time in total.
- 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
Following my idea of using a enlarged random image...
Generate a 2-pixel wide, long random image. Extract one greyscale channel
and with a highly fuzzy filter enlarge and color it.
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.
Code: Select all
convert -size 20x2 xc: +noise random -separate -delete 1--1 \
-filter gaussian -resize 100x100\! +level-colors ,DodgerBlue \
random_folds.jpg
and with a highly fuzzy filter enlarge and color it.
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/
https://imagemagick.org/Usage/
- 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
Yes, I think Anthony is onto the better solution.
Fred
Fred