That is pretty much what I was doing before. This works. I make white into binary transparent (black or white). Then I extract the alpha channel. Then I flatten the image over green (which is not a color in my image). Then I put the alpha channel back.
convert logo: logo.png
convert \( logo.png -transparent white \) \
\( -clone 0 -alpha extract \) \
\( -clone 0 -background green -flatten \) \
-delete 0 +swap -alpha off -compose copy_opacity -composite \
logo_palette_transp_green.png
identify -verbose logo_palette_transp_green.png
Image: logo_palette_transp_green.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 640x480+0+0
Resolution: 72x72
Print size: 8.88889x6.66667
Units: Undefined
Type: PaletteMatte
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
Channel statistics:
Red:
min: 0 (0)
max: 255 (1)
mean: 18.0637 (0.070838)
standard deviation: 56.684 (0.22229)
kurtosis: 9.5292
skewness: 3.29833
Green:
min: 6 (0.0235294)
max: 255 (1)
mean: 124.322 (0.487535)
standard deviation: 29.3121 (0.114949)
kurtosis: 6.99327
skewness: -0.138574
Blue:
min: 0 (0)
max: 245 (0.960784)
mean: 21.9873 (0.0862246)
standard deviation: 54.4317 (0.213458)
kurtosis: 4.71114
skewness: 2.43479
Alpha:
min: 0 (0)
max: 255 (1)
mean: 44.6997 (0.175293)
standard deviation: 96.9555 (0.380217)
kurtosis: 0.917287
skewness: -1.70801
# now turn off the alpha to see if background is green
convert logo_palette_transp_green.png -alpha off logo_palette_transp_green_aoff.png
