Page 1 of 1

How to convert a PNG with full transparency into 50% transparent?

Posted: 2018-01-04T06:19:09-07:00
by xberg
Hi,

The PNG has some areas completely transparent and other areas fully opaque. I only want to have the opaque areas 50% transparent while keeping full transparency in the areas which are already fully transparent.

This is what I do:

Code: Select all

magick in.png -alpha set -channel A -evaluate set 50% +channel out.png
However this fills the areas that are 100% transparent with 50% opacity which is not what I want.

Re: How to convert a PNG with full transparency into 50% transparent?

Posted: 2018-01-04T06:44:07-07:00
by xberg
OK, I found the solution: use multiply:

magick convert 1.jpg -alpha set -channel A -evaluate multiply 0.50 +channel logo-just-transparent50pc-alpha.png