Possible to convert the alpha channel to unmatted?

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?".
imlost123
Posts: 15
Joined: 2017-02-02T04:46:49-07:00
Authentication code: 1151

Possible to convert the alpha channel to unmatted?

Post by imlost123 »

Hi. I converted some svgs into pngs and it was good. they looked fine with all the transparencies intact when i imported them to photoshop however when i imported the pngs into sony vegas all the transparencies show up as black and the only way that i know to fix it is to change the alpha channel properties to straight(unmatted) and then the transparencies show again.
maybe this is more a problem with sony vegas but is there a way to batch fix them in imagemagick as i have to do them manually in vegas which takes too long

i've been experimenting with the alpha options but nothing seems to have worked yet.

im just using basic commands like
convert 1.svg -density 500 -alpha (?how do i make it unmatted?) -resize 500 1.png

thanks!

maybe more a problem with sony vegas though as they work fine in photoshop?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Possible to convert the alpha channel to unmatted?

Post by snibgo »

What does "straight(unmatted)" mean?

I suggest you post a PNG that Sony Vegas can't read, then a version of the same file that is fixed so it can read it.
snibgo's IM pages: im.snibgo.com
imlost123
Posts: 15
Joined: 2017-02-02T04:46:49-07:00
Authentication code: 1151

Re: Possible to convert the alpha channel to unmatted?

Post by imlost123 »

Ha I was hoping you'd know what it meant! ;-)

When I load the png into sony vegas the transparency is black and I have to right click the png and choose properties/edit/ then click this option on alphachannel from "none" to "straight(unmatted)" and that fixes it
Image

This is the saved png that works in sony vegas after unmatting it
http://i.imgur.com/EhdYk6G.png

This is the original png out of imagemagick
http://i.imgur.com/4sUQbpv.png
The transparencies show up fine in photoshop, illustrator and other programs but not with sony vegas. Other pngs work fine in vegas so the issue was when converting them originally from svg to png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible to convert the alpha channel to unmatted?

Post by fmw42 »

The main differences I see in the two files are:

1) The good one is 8 bit per channel and the IM one is 16 bit per channel
2) The good one has size 4096x2304 and the IM one has size 2160x2160

It could be the bit depth and density. What was the command you used to create the IM version? Try adding -depth 8 before the output.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Possible to convert the alpha channel to unmatted?

Post by snibgo »

imlost123 wrote:Other pngs work fine in vegas ...
Can you post a link to one of those?
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible to convert the alpha channel to unmatted?

Post by fmw42 »

imlost123
Posts: 15
Joined: 2017-02-02T04:46:49-07:00
Authentication code: 1151

Re: Possible to convert the alpha channel to unmatted?

Post by imlost123 »

snibgo wrote: 2017-02-27T11:23:42-07:00
imlost123 wrote:Other pngs work fine in vegas ...
Can you post a link to one of those?
None that I have edited in imagemagick myself but just any transparent image will usually work fine 95%+ of the time easily in vegas.
http://i.imgur.com/lr6lZND.png

This png is from the original svg and works fine in vegas and was edited with an online converter instead of imagemagick
http://i.imgur.com/XccE4uy.png
This is the original png out of imagemagick (posted in my last post)
http://i.imgur.com/4sUQbpv.png

Tried the depth8 with no difference.

unsure of the exact line i used but think it was just a mogrify -background none -density 5000
imlost123
Posts: 15
Joined: 2017-02-02T04:46:49-07:00
Authentication code: 1151

Re: Possible to convert the alpha channel to unmatted?

Post by imlost123 »

fmw42 wrote: 2017-02-27T11:34:06-07:00 Have you tried http://www.google.com/url?q=https://www ... K3CJhoRQ1w
Yeah that's what I've been doing and it works but I was wanting to add hundreds of images automatically and the only way to do that is to right click each one one after the other which would be long. There's no way of automating it or pasting event attributes for this in vegas sadly. So was hoping there might be something at this end could be done.
The problem must be with vegas as they work fine in everything else without having to "unmatt" them.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible to convert the alpha channel to unmatted?

Post by fmw42 »

Do you have to unmatte svg to pngs using GIMP or Photoshop or any other tool?

Without your exact command line, it is hard to know what may different about IM. What is your IM version and platform? What is your version of libpng that IM uses. See

convert -version

for the IM version and delegates.


convert -list format
PNG* PNG rw- Portable Network Graphics (libpng 1.6.28)

for the libpng version.


Perhaps you need to upgrade either IM and or libpng
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible to convert the alpha channel to unmatted?

Post by fmw42 »

This png is from the original svg and works fine in vegas and was edited with an online converter instead of imagemagick
What specific tool did you use?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible to convert the alpha channel to unmatted?

Post by fmw42 »

Post your svg file and we can convert to png and you can try that.
imlost123
Posts: 15
Joined: 2017-02-02T04:46:49-07:00
Authentication code: 1151

Re: Possible to convert the alpha channel to unmatted?

Post by imlost123 »

fmw42 wrote: 2017-02-27T12:16:00-07:00 Post your svg file and we can convert to png and you can try that.
This is the original svg
http://www.filedropper.com/00a9
imlost123
Posts: 15
Joined: 2017-02-02T04:46:49-07:00
Authentication code: 1151

Re: Possible to convert the alpha channel to unmatted?

Post by imlost123 »

fmw42 wrote: 2017-02-27T12:15:27-07:00
This png is from the original svg and works fine in vegas and was edited with an online converter instead of imagemagick
What specific tool did you use?
was this online convertor
https://cloudconvert.com/svg-to-png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible to convert the alpha channel to unmatted?

Post by fmw42 »

Do either of these images work?

Code: Select all

convert 00a9.svg -transparent white 00a9_im16.png
http://www.fmwconcepts.com/misc_tests/s ... 9_im16.png

Code: Select all

convert 00a9.svg -transparent white -depth 8 00a9_im8.png
http://www.fmwconcepts.com/misc_tests/s ... a9_im8.png

Using IM 6.9.7.9 Q16 Mac OSX


If neither work, then does this one.
http://www.fmwconcepts.com/misc_tests/s ... _cloud.png
imlost123
Posts: 15
Joined: 2017-02-02T04:46:49-07:00
Authentication code: 1151

Re: Possible to convert the alpha channel to unmatted?

Post by imlost123 »

fmw42 wrote: 2017-02-27T13:34:42-07:00 Do either of these images work?

Code: Select all

convert 00a9.svg -transparent white 00a9_im16.png
http://www.fmwconcepts.com/misc_tests/s ... 9_im16.png

Code: Select all

convert 00a9.svg -transparent white -depth 8 00a9_im8.png
http://www.fmwconcepts.com/misc_tests/s ... a9_im8.png

Using IM 6.9.7.9 Q16 Mac OSX

If neither work, then does this one.
http://www.fmwconcepts.com/misc_tests/s ... _cloud.png

Yes! The third one works!
How did you do that? :-P
Last edited by imlost123 on 2017-02-27T13:53:03-07:00, edited 3 times in total.
Post Reply