Copyright © Fred Weinhaus My scripts are available free of charge for non-commercial (non-profit) use, ONLY. For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net. If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment. Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php Please read the Pointers For Use on my home page to properly install and customize my scripts. |
Transforms an image to place it in a region of a tshirt image using an external lighting and displacement map |
last modified: July 17, 2020
USAGE: tshirtwarp lightingfile displacementfile infile backgroundfile outfile PURPOSE: To apply an image to a region of of a tshirt image using a lighting file, a displacement map and arguments provided by the script tshirt. DESCRIPTION: TSHIRTWARP applies an image to a region of a tshirt image using a lighting file, a displacement map and arguments provided by the script tshirt. The arguments must be copied from the tshirt script output at the terminal and pasted in the arguments section of this script, if no directory file was specified during the running of the tshirt script. If a directory was specified, then all the images and textual data will be written to that directory and only the directory needs to be specified with the infile and backgroundfile and outfile. The latter mode with the directory permits one tshirtwarp script to be used with all style tshirts, rather than save a customized script for each style tshirt. REQUIREMENTS: IM 6.3.6-0 due to the use of the current control point ordering. Also requires the preprocessing of the tshirt script in export mode (-E) to get the lighting image (lighting.png), the displacement image (displace.png) and to get the needed internal arguments that must be pasted in this script below. CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk. |
First Run Tshirt Script With Option -E To Get Lighting Image, Displacement Map and Terminal Listing |
|
Input (Overlay) Image |
|
![]() |
|
Background (Tshirt )Image |
|
![]() |
|
Arguments: |
|
![]() |
|
Lighting Image |
|
![]() |
|
Displacement Image |
|
![]() |
|
Terminal Listing |
|
coordinates="0,0 276,179 478,0 405,172 478,478 411,300 0,478 283,307" |
Now Copy And Past the Terminal Text into the Tshirtwarp Script |
Lighting Image |
![]() |
Displacement Image |
![]() |
Input (Overlay) Image |
![]() |
Background (Tshirt )Image |
![]() |
Arguments: |
![]() |
Alternately, Run Tshirt Script With Option -E -D path2/data_directory |
|
Input (Overlay) Image |
|
![]() |
|
Background (Tshirt )Image |
|
![]() |
|
Arguments: |
|
![]() |
|
Textual Data listed At the terminal and written to a file called tshirtdata.txt in the data_directory |
|
coordinates="0,0 276,179 478,0 405,172 478,478 411,300 0,478 283,307" |
Now Run The tshirtwarp script supplying data_directory followed by your overlayfile, tshirtfile and outputfile |
Input (Overlay) Image |
![]() |
Background (Tshirt )Image |
![]() |
Arguments: |
![]() |
What the script does is as follows:
|