hasAlpha
24. 11. 2019stackoverflow.com/…/detect-alpha-channel-with-imagemagick
identify -format %A piCase2.png
True
Composite one with alpha over checkerboard pattern
x="640"; y="480"
convert piCase2.png -resize ${x}x${y} -background none -gravity center -extent ${x}x${y} \( -size ${x}x${y} tile:pattern:checkerboard \) +swap -composite tmp.png
Extract alpha and upload as separated file?
# extract alpha
convert rgba.png -alpha extract alpha.png
# ectract rgb (for testing recomposing)
convert rgba.png -alpha off rgb.png
Recompose to singular image
convert rgb.png alpha.png -alpha off -compose CopyOpacity -composite recomposeRGBA.png
This also works rather well when rgb is jpeged.
Note: This will not work well when rgb is precomposed to certain color (solution?)