Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
the first frame of the psd file image.psd[0] is the flattened image. so if you are flattening all layers in the file, you will have it flattened twice. if you just want the flattened layer, then just specify image.psd[0]
-background red is an setting and not an action, so it does nothing here as far as I understand it. it needs to be used with some other action type option
don't know why you get unusable PS results, but I think this has been reported before. but possibly due to user misunderstanding. Cannot say if it is a bug or not.
convert layers.psd -resize 50x50 -background red layers-50x50-red.psd
the resulting PSD file is still unusable.
I know how to circumvent the situation by using a single layer.
The point I wanted to make is that without any error message or exit code != 0 IM is producing an usable file.
This is difficult to detect if you do batch processing.
convert layers.psd -resize 50x50 -background red layers-50x50-red.psd
background red is still useless in this situation, it only applies with certain commands, such as -layers, -flatten, -rotate, label, caption and should be put before these options.
convert layers.psd -background red -flatten layers_flattened_red.psd
but the first layer of the psd is already a flattened file, so you may have to exclude it from the frames.
layers.psd[1--1] for example I believe is all frames but the first one [0].