I have a black-and-white image where want to add transparency.
I need multiple transparency levels according to the grey level of each pixel. If a pixel is close to black, it must be opaque (less transparent). If grey, medium transparent, and if white, almost 100% transparent.Is there a way to do this? Does a .png format even support such multiple transparencies?
Thanks for your help in advance.
Multiple opacities in an image
-
- Posts: 1
- Joined: 2018-09-26T09:35:41-07:00
- Authentication code: 1152
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Multiple opacities in an image
Yes, PNG supports 8-bit transparency. The command should be
see
https://imagemagick.org/Usage/masking/#alpha_copy
If that does not work. Then in Unix
For Windows,
_____________________
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
Code: Select all
convert image.png -alpha copy image.png
https://imagemagick.org/Usage/masking/#alpha_copy
If that does not work. Then in Unix
Code: Select all
convert image.png \( +clone \) -alpha off -compose copy_opacity -composite image.png
Code: Select all
convert image.png ( +clone ) -alpha off -compose copy_opacity -composite image.png
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown