texture , effect 3D
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: texture , effect 3D
I believe they would start with a flat texture image, then 'warp' it using a pre-generated 'distort or displacement map' Shading and overlaying would then be applied.
See IM Examples, Image Mapping Effects, Distorts and Displacements
http://www.imagemagick.org/Usage/mapping/#distort
whcih will introduce you to the concepts.
See IM Examples, Image Mapping Effects, Distorts and Displacements
http://www.imagemagick.org/Usage/mapping/#distort
whcih will introduce you to the concepts.
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: texture , effect 3D
Sometimes you can take the graytone image and adjust its contrast and brightness and use that for the displacement map.
see examples at
viewtopic.php?f=1&t=16921&p=62696&hilit ... irt#p62696
viewtopic.php?f=1&t=20455&p=81771&hilit ... ace#p81771
But as Anthony says, you may have to adjust the displacement map or create a better one.
I have not given this much thought, but perhaps one can take the shoe and make it binary (b/w) and then use -morphology distance to create a grayscale displacement map. see http://www.imagemagick.org/Usage/morphology/#distance
see examples at
viewtopic.php?f=1&t=16921&p=62696&hilit ... irt#p62696
viewtopic.php?f=1&t=20455&p=81771&hilit ... ace#p81771
But as Anthony says, you may have to adjust the displacement map or create a better one.
I have not given this much thought, but perhaps one can take the shoe and make it binary (b/w) and then use -morphology distance to create a grayscale displacement map. see http://www.imagemagick.org/Usage/morphology/#distance
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: texture , effect 3D
I don't thnk mathematical methods would work well here.
The definate bend and compession along the top surface to make it look right needs some work.
One way to help with this is to get photos of a object with a checkerboard pattern to it. The check corners can then be used to define control points in setting up the distortion/displacement map needed.
The definate bend and compession along the top surface to make it look right needs some work.
One way to help with this is to get photos of a object with a checkerboard pattern to it. The check corners can then be used to define control points in setting up the distortion/displacement map needed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: texture , effect 3D
souonds like very hard to do.. maybe smb will do some simple example how to put similiar texture on such shoe?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: texture , effect 3D
smb -- what or who is that?stefek143 wrote:souonds like very hard to do.. maybe smb will do some simple example how to put similiar texture on such shoe?
Re: texture , effect 3D
smb - somebody
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: texture , effect 3D
I don't think anyone here knows exactly how to do that without using 3D modeling and texture mapping software. IM does is only a 2D image processor. So there is only so much it can do.
You have been given ideas with which to experiment. I think that is the best we can do. If some one else has any ideas, I am sure they will add their comments or examples.
Do you have the original texture image that you want to overlay onto the shoe? If so, post that as well, otherwise no one can do any testing to compare to your result.
You have been given ideas with which to experiment. I think that is the best we can do. If some one else has any ideas, I am sure they will add their comments or examples.
Do you have the original texture image that you want to overlay onto the shoe? If so, post that as well, otherwise no one can do any testing to compare to your result.
Last edited by fmw42 on 2012-04-10T20:51:25-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: texture , effect 3D
It should not be hard to do. Just need a little artisty in a image editor like gimp to generate the maps.
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: texture , effect 3D
If you want others to try something, we need the original texture image that you are trying to put on the shoe.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: texture , effect 3D
It would have been nicer to have the same original texture image so that one can compare.
Nevertheless, your texture image is not the same size as your shoe image, so it needs to be stretched. But try this. It is the very same technique used in the two examples listed above for similar things.
(Change the amount below to make the distortion increase)
(NOTE for ease of my use, I renamed images and I added 1 as a prefix to all images)
amount=5
convert \( 1dollar.jpg -resize 180x151! \) \( 1shoe.jpg -auto-level \) \
-virtual-pixel transparent -compose displace \
-set option:compose:args -${amount}x-${amount} -composite 1dollar_dm${amount}.png
convert 1shoe.jpg 1dollar_dm${amount}.png \( -clone 0 -threshold 55% \) \
-compose over -composite 1shoe_1dollar_dm${amount}_comp.png
Note I did -auto-level on the shoe so as the make the effect more intense in the first command
I also thresholded the shoe to make a mask for compositing the texture over the shoe in the second command
This is effectively a "shape from shading" method using the shading as a displacement map.
P.S. It occurs to me that some of the "effect" may just be coming from the stretched overlay image. So a larger image that can be cropped to the right size, might be a better indication.
So I made a grid pattern
convert -size 180x151 pattern:hs_cross 1grid.png
Then applied the same processing:
amount=5
convert 1grid.png \( 1shoe.jpg -auto-level \) \
-virtual-pixel transparent -compose displace \
-set option:compose:args -${amount}x-${amount} -composite 1grid_dm${amount}.png
convert 1shoe.jpg 1grid_dm${amount}.png \( -clone 0 -threshold 55% \) \
-compose over -composite 1shoe_1grid_dm${amount}_comp.png
Nevertheless, your texture image is not the same size as your shoe image, so it needs to be stretched. But try this. It is the very same technique used in the two examples listed above for similar things.
(Change the amount below to make the distortion increase)
(NOTE for ease of my use, I renamed images and I added 1 as a prefix to all images)
amount=5
convert \( 1dollar.jpg -resize 180x151! \) \( 1shoe.jpg -auto-level \) \
-virtual-pixel transparent -compose displace \
-set option:compose:args -${amount}x-${amount} -composite 1dollar_dm${amount}.png
convert 1shoe.jpg 1dollar_dm${amount}.png \( -clone 0 -threshold 55% \) \
-compose over -composite 1shoe_1dollar_dm${amount}_comp.png
Note I did -auto-level on the shoe so as the make the effect more intense in the first command
I also thresholded the shoe to make a mask for compositing the texture over the shoe in the second command
This is effectively a "shape from shading" method using the shading as a displacement map.
P.S. It occurs to me that some of the "effect" may just be coming from the stretched overlay image. So a larger image that can be cropped to the right size, might be a better indication.
So I made a grid pattern
convert -size 180x151 pattern:hs_cross 1grid.png
Then applied the same processing:
amount=5
convert 1grid.png \( 1shoe.jpg -auto-level \) \
-virtual-pixel transparent -compose displace \
-set option:compose:args -${amount}x-${amount} -composite 1grid_dm${amount}.png
convert 1shoe.jpg 1grid_dm${amount}.png \( -clone 0 -threshold 55% \) \
-compose over -composite 1shoe_1grid_dm${amount}_comp.png
Re: texture , effect 3D
thank you !
your effect is really god but one main thing I dont see, please look on my picture :
as you can see the area what I've marked in this place has effect like "arch", texture(dollar) begin from the top and go down with "arch effect" and this make effect 3D. On texture with letters (few posts above) is possible to better see. Letter move from top to bottom without deformation and all of this make 3D effect.
your effect is really god but one main thing I dont see, please look on my picture :
as you can see the area what I've marked in this place has effect like "arch", texture(dollar) begin from the top and go down with "arch effect" and this make effect 3D. On texture with letters (few posts above) is possible to better see. Letter move from top to bottom without deformation and all of this make 3D effect.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: texture , effect 3D
I am not sure I understand what you think is wrong. Try increasing the amount parameter to increase the effect. Otherwise you may have to manually paint the mask to change the shading to get the effect you want.