I've tried using pdfextract
to extract images from a PDF and while it does extract the images I want, it extracts them with a black background. However, it also extracts a "mask" image, which I believe is the alpha channel.
I've read through http://www.imagemagick.org/Usage/masking, but I see no example for applying an already-extracted mask to an existing image to restore transparency. Is there a way to do this using imagemagick? If not, is there an easier way to extract images from a pdf while preserving transparency?