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?".
sujan.dasmahapatra
Posts: 44 Joined: 2012-02-18T21:42:01-07:00
Authentication code: 8675308
Post
by sujan.dasmahapatra » 2012-03-09T04:44:15-07:00
I am using a pattern tile and putting that on my white shirt with black background successfully. But the pattern seems bigger than my shirt size so looking odd. Can there be some method to increase the density of the pattern and then use it. see my pattern tile
http://imageshack.us/photo/my-images/521/15898.png/
This is how I am putting the pattern on the shirt.
Code: Select all
exec("convert -background black -extent 0x0 -matte bodynormalclassic.png bodynormalclassic_b.png");
exec("convert 15898.png -normalize +level 35% texture.png");
exec("composite texture.png bodynormalclassic_b.png -tile -compose Hardlight texture2.png");
exec("convert bodynormalclassic_b.png -fuzz 50% -transparent white -alpha extract -negate mask.png");
exec("convert bodynormalclassic_b.png texture2.png mask.png -composite bodynormalclassic_mod3.png");
any help would be highly appreciated. thanks
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2012-03-09T06:28:19-07:00
Resize the pattern, and tile it to the right size before overlaying.
Examples of handling tiling images are in IM examples, Canvas, Tiled Canvases
http://www.imagemagick.org/Usage/canvas/#tile
sujan.dasmahapatra
Posts: 44 Joined: 2012-02-18T21:42:01-07:00
Authentication code: 8675308
Post
by sujan.dasmahapatra » 2012-03-10T08:35:54-07:00
I ont think if sizing will work out. I want more densed pattern. I have tried to increase the size like this but this changing the pattern to black color. and not increasing the density.
Code: Select all
exec("convert -background black -extent 0x0 -matte bodynormalclassic.png bodynormalclassic_b.png");
exec("convert 15898.png -normalize +level 35% texture.png");
exec("composite texture.png bodynormalclassic_b.png -tile -size 1000*1000 -compose Hardlight texture2.png");
exec("convert bodynormalclassic_b.png -fuzz 50% -transparent white -alpha extract -negate mask.png");
exec("convert bodynormalclassic_b.png texture2.png mask.png -composite bodynormalclassic_mod3.png");
How can i make the pattern more densed.
sujan.dasmahapatra
Posts: 44 Joined: 2012-02-18T21:42:01-07:00
Authentication code: 8675308
Post
by sujan.dasmahapatra » 2012-03-11T08:01:13-07:00
is there any mechanism by which i can get more no. of lines of the image. now from the image i am getting some 7 strips on the shirt, i want more refined strips may be 150 or 20 like that. Any suggestions would be appreciated. thanks
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-03-11T11:51:54-07:00
You need to reduce the size of your pattern, make sure it is tileable (that is it repeats properly) and then tile it out larger.
see
http://www.imagemagick.org/Usage/canvas/#tile
Your pattern is not perfectly vertical and also needed a few pixels removed so that the blue stripes were the same size all accross. This is about the best I can do:
convert 15898.png -gravity east -chop 8x0 -resize 25% \
-write mpr:stripes +delete \
-size 480x480 tile:mpr:stripes 15898_0p25_tiled.png
sujan.dasmahapatra
Posts: 44 Joined: 2012-02-18T21:42:01-07:00
Authentication code: 8675308
Post
by sujan.dasmahapatra » 2012-03-11T21:02:48-07:00
One problem is happening with other tile images. That image blue stirpes is working fine. but this image red color is being faded, red stripes are not visible with this. please this link. How the color could be darker with the actual color shade.
http://imageshack.us/photo/my-images/5 ... his shirt
color is faded with this
exec("convert 15881.png -gravity east -chop 8x0 -resize 25% -write mpr:stripes +delete -size 480x480 tile:mpr:stripes texture.png");
I have tried with increasing the -resize 75% but the color is still faded. Please help. thanks
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-03-11T21:52:15-07:00
try
convert 15871.png -gravity east -chop 24x0 -gravity south -chop 0x24 -scale 25% -level 30x100% \
-write mpr:stripes +delete \
-size 480x480 tile:mpr:stripes 15871_0p25_tiled.png
sujan.dasmahapatra
Posts: 44 Joined: 2012-02-18T21:42:01-07:00
Authentication code: 8675308
Post
by sujan.dasmahapatra » 2012-03-12T08:22:36-07:00
Code: Select all
exec("convert -background black -extent 0x0 -matte bodynormalclassic.png bodynormalclassic_b.png");
exec("convert 15919.png -gravity east -chop 8x0 -resize 75% -level 40x100% -write mpr:stripes +delete -size 480x480 tile:mpr:stripes texture.png");
exec("composite texture.png bodynormalclassic_b.png -tile -compose Hardlight texture2.png");
exec("convert bodynormalclassic_b.png -fuzz 50% -transparent white -alpha extract -negate mask.png");
exec("convert bodynormalclassic_b.png texture2.png mask.png -composite bodynormalclassic_mod4.png");
exec("convert -background black -extent 0x0 -matte sleevelongnormal.png sleevelongnormal_black.png");
exec("convert 15919.png -gravity east -chop 8x0 -resize 75% -level 30x100% -write mpr:stripes +delete -size 480x480 tile:mpr:stripes texture.png");
exec("composite texture.png sleevelongnormal_black.png -tile -compose Hardlight texture2.png");
exec("convert sleevelongnormal_black.png -fuzz 50% -transparent white -alpha extract -negate mask.png");
exec("convert sleevelongnormal_black.png texture2.png mask.png -composite sleevelongnormal_mod4.png");
exec("convert -background black -extent 0x0 -matte collar104o.png collar104o_black.png");
exec("convert 15919.png -gravity east -chop 8x0 -resize 25% -level 30x100% -write mpr:stripes +delete -size 480x480 tile:mpr:stripes texture.png");
exec("composite texture.png collar104o_black.png -tile -compose Hardlight texture2.png");
exec("convert collar104o_black.png -fuzz 50% -transparent white -alpha extract -negate mask.png");
exec("convert collar104o_black.png texture2.png mask.png -composite collar104o_mod4.png");
exec("convert -background black -extent 0x0 -matte cuff114o.png cuff114o_black.png");
exec("convert 15919.png -gravity east -chop 8x0 -resize 25% -level 30x100% -write mpr:stripes +delete -size 480x480 tile:mpr:stripes texture.png");
exec("composite texture.png cuff114o_black.png -tile -compose Hardlight texture2.png");
exec("convert cuff114o_black.png -fuzz 50% -transparent white -alpha extract -negate mask.png");
exec("convert cuff114o_black.png texture2.png mask.png -composite cuff114o_mod4.png");
exec("convert sleevelongnormal_mod4.png bodynormalclassic_mod4.png collar104o_mod4.png cuff114o_mod4.png collar105b.png collar105i.png collarbutton902.png --fuzz 20% -transparent black -background black -flatten miff:- | convert - -median 3x3 shirtmod4.png");
$imagepath = "shirtmod4.png";
echo "<img style='float:right;' src='$imagepath' />";
Please check the code above below are images of the tile and output shirt. It's completely faded , please help me how can I make it darker
http://imageshack.us/photo/my-images/8 ... mod4.png/
Please help me.
sujan.dasmahapatra
Posts: 44 Joined: 2012-02-18T21:42:01-07:00
Authentication code: 8675308
Post
by sujan.dasmahapatra » 2012-03-12T11:16:27-07:00
If I write as layers merge like below
exec("convert bodynormalclassic_mod4.png sleevelongnormal_mod4.png -compose plus -layers merge shirtmodfour4.png");
then the shade is coming proper but there is overlapping. How can I handle this please help.
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2012-03-12T11:56:23-07:00
Your best bet is to create your own stripes pattern of exactly the size you need without resizing and tile it out.
This will make white spaces of 10 and 2 pixel blue stripes, so cell size of 12
convert \( -size 12x12 xc:blue \) \( -size 10x10 xc:white \) -compose over -composite \
-write mpr:stripes +delete \
-size 480x480 tile:mpr:stripes blue_stripes.png