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?".
It is an outline of a t-shirt. The area that makes up the t-shirt is transparent while the area outside the shirt is white. What I want to do is create a colored background for this PNG and turn my transparent shirt into any color shirt I want.
I can't seem to get anywhere with this. Any pointers? I'm not sure I have a complete grasp of how IM interprets PNGs and their alpha channels, so maybe something is wrong with my image. I'm up for anything.
I recreated my PNG file to confirm that it really was a 32bit file. Remarkably, the file size was 4 times larger, so I'm thinking there may have been a problem with the other file.
IIRC composite didn't work well in V6.0.x. I'm using 6.3.2 and your command produces a red shirt on a white background.
Upgrade your IM and then try the command again.
Bonzo: The composite command works great. Thanks! I've verified that it works with hex color values too. Now I'm just going to have to figure out the best way to work with blank shirt files of different sizes.
Pete: I'd love to upgrade to the current IM, but I'm on a shared host and they probably won't do it for me (though I'll ask).
If you were on a later version you could use an fx comand to set the -size to match the original image although I have never been able to get this to work for me using php.
If you are using this with php you can use getimagesize and put the width and height into variables then use these variables in the -size command.
You can also get the image size with IM but you need to be able to get that into a variable. I did it once and will have to look back over my posts and see how I did it.