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?".
The first piece of code will not works as jpg does not support transparnecy.
The second piece of code is confusing and I belive you do not need the null: or the -compose HardLight or the -format jpg probably not the -strip either. I do not know what effect you are after but I would start again one effect at a time.
Bonzo, thanks, but your comments do not help. Firstly, the first piece of code DOES work with only one exception: the background is black. I want the background to be red. When I take out those things you suggested, it breaks.
How can I get a red canvas instead of a black canvas?
I'm not sure what you are trying to get, but you could try using "#FF000000" instead of "transparent" (that is, transparent red instead of opaque red) as the canvas.