Page 1 of 1

Pleated output

Posted: 2011-04-07T23:16:38-07:00
by dugar
I needed some help regarding image manipulation.

The input image is a simple random printed background ( http://img855.imageshack.us/i/picfabric.jpg/).

The output required is a pleated version of it, one end of which is held closely (http://img9.imageshack.us/i/picfabric2.jpg/).

Can you please guide me how this can be achieved. I tried extracting parts, shearing them and then superimposing all, but gives a very discrete effect.

Is there some way I can do this by literally displacing some co-ordinates considering them as vertices.

Thank you.

Re: Pleated output

Posted: 2011-04-08T00:21:31-07:00
by anthony
This is very hard. But I can see two techniques.

One is to divide and distort each 'fold' separately and join it back together.

The other way is to use an image map that has been distorted (edited) into the desired shape that maps 'destination pixel color' from 'source pixel location.
http://www.imagemagick.org/Usage/mappin ... rtion_maps

Note a -compose Distort method has been created for this (to complement the -compose Displace method) but it the above examples page has not been re-written to example it properly.

Once you have the colors in the right place it is only a matter of masking the background, and adding lighting effects (highlights, shading, and shadows).


Note once you have the first technique of 'direct distortion of pieces', it can be easily converted into the faster second 'distortion map' technique by applying it to two grayscale images, One for X and one for Y. That can even be converted to a third 'displacement map' technique though I don't think that is necessary for this type of thing.

Re: Pleated output

Posted: 2011-04-11T06:26:28-07:00
by dugar
Thank you for your suggestion. I will definitely need to increase my ImageMagick knowledge to accomplish this. I will definitely try
to do it.

Any other way/suggestions to do the above shall be helpful.

Re: Pleated output

Posted: 2011-04-11T17:30:14-07:00
by anthony
Yes. Generate the distortion at a larger scale. That way sharp folds can be smoothed (anti-aliased) by shrinking the final result.

Re: Pleated output

Posted: 2011-04-24T11:17:41-07:00
by fmw42
You could combine -wave with -distort perspective or -distort BilinearForward

Image

convert picfabric2.jpg -wave 30x92 MIFF:- |\
3Drotate tilt=60 bgcolor=white vp="background" auto=out - picfabric2_folds.jpg

Image