RGB SVG to Targe with Alpha Channel

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
kpettit

RGB SVG to Targe with Alpha Channel

Post by kpettit »

Hi all,
New to Im. Looking for a way to convert an SVG with transparancies to a Targa with Alpha channel.
Is this possible through IM?

Want to extract alpha from SVG then create grey scale with data to then be applied like below.

Code: Select all

convert = "composite -compose Copy_Opacity greyscale.jpg  red2.jpg  compose_mask.tga"
Sincerely,
Ken...
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: RGB SVG to Targe with Alpha Channel

Post by anthony »

That should work. As you are using JPG (not a good idea as JPG is inexact) you do not have any matte channel to remove before the composition. As such the CopyOpacity composition should use the source image as a greyscale mask.

What does "identify" say about the result?

Have you tried it with PNG to see if that produces transparency?

Can you give us some example images where it is failing?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
kpettit

Re: RGB SVG to Targe with Alpha Channel

Post by kpettit »

If possible I would like to only use one file to convert an transparent SVG to a Targa with an Alpha Channel.

Here is the code I'm using right now... It renders transparencies as opaque.

Code: Select all

$convert = "convert -background none 7.svg 7.tga";
Here is the SVG.
http://www.deliciousbanner.com/imageMag ... ages/7.svg

This is the converted file it returns.
http://www.deliciousbanner.com/imageMag ... ages/7.tga

Ken...
Post Reply