unclear about -alpha on with IM 6.4.3-8
Posted: 2008-09-23T15:29:46-07:00
The documentation says:
"On or Activate Enable the images use of transparency. If transparency data did not exist, allocate the data and set to opaque. If the image previously had transparency data, the data is again enable as it was when turned off."
Thus if I create a gradient, use -alpha copy to copy the gradient to the alpha channel, then turn off the alpha and then turn it on, I would expect the alpha channel to show the gradient again. But it is fully opaque, just the same as using -alpha set or -alpha opaque.
convert -size 100x100 gradient: grad.png
convert grad.png -alpha copy grad_acopy.png
convert grad_acopy.png -alpha off grad_acopy_aoff.png
convert grad_acopy_aoff.png -alpha on grad_acopy_aoff_aon.png
convert grad_acopy_aoff_aon.png -verbose info:
alpha:
min: 65535 (1)
max: 65535 (1)
mean: 65535 (1)
standard deviation: -0 (-0)
Am I misunderstanding this, since each command is on a separate command line?
Whereas, this works as one command line:
convert -size 100x100 gradient: -alpha copy -alpha off -alpha on grad_acopy_aoff_aon.png
convert grad_acopy_aoff_aon.png -verbose info:
alpha:
min: 0 (0)
max: 65535 (1)
mean: 32767.5 (0.5)
standard deviation: 19108.4 (0.291576)
But then, I don't understand why someone would want to do the latter --- turn it off, then on, all in the same command line.
Thus why is there a need for a difference between -alpha on/activate and -alpha set? (Not that extra options are bad)
"On or Activate Enable the images use of transparency. If transparency data did not exist, allocate the data and set to opaque. If the image previously had transparency data, the data is again enable as it was when turned off."
Thus if I create a gradient, use -alpha copy to copy the gradient to the alpha channel, then turn off the alpha and then turn it on, I would expect the alpha channel to show the gradient again. But it is fully opaque, just the same as using -alpha set or -alpha opaque.
convert -size 100x100 gradient: grad.png
convert grad.png -alpha copy grad_acopy.png
convert grad_acopy.png -alpha off grad_acopy_aoff.png
convert grad_acopy_aoff.png -alpha on grad_acopy_aoff_aon.png
convert grad_acopy_aoff_aon.png -verbose info:
alpha:
min: 65535 (1)
max: 65535 (1)
mean: 65535 (1)
standard deviation: -0 (-0)
Am I misunderstanding this, since each command is on a separate command line?
Whereas, this works as one command line:
convert -size 100x100 gradient: -alpha copy -alpha off -alpha on grad_acopy_aoff_aon.png
convert grad_acopy_aoff_aon.png -verbose info:
alpha:
min: 0 (0)
max: 65535 (1)
mean: 32767.5 (0.5)
standard deviation: 19108.4 (0.291576)
But then, I don't understand why someone would want to do the latter --- turn it off, then on, all in the same command line.
Thus why is there a need for a difference between -alpha on/activate and -alpha set? (Not that extra options are bad)