Help with transparency to a newbie
-
- Posts: 5
- Joined: 2018-07-20T18:29:45-07:00
- Authentication code: 1152
Help with transparency to a newbie
Hi i'm using this code i found on the net which uses ImageMagick:
And on this field who generates that background, if i clear it the whole background becames full transparent, but what i wanted to do is to set the image to match my terminal, which uses the color #000 with 70% opacity. Is there a way to do it? I tried to fint through the search engine but every code i tried (some like this: \( -alpha set -channel A -evaluate set 60% \) -draw "image over 169,555 875,109 'img1.png'") but it didnt work, can someone help me please?
And on this field who generates that background, if i clear it the whole background becames full transparent, but what i wanted to do is to set the image to match my terminal, which uses the color #000 with 70% opacity. Is there a way to do it? I tried to fint through the search engine but every code i tried (some like this: \( -alpha set -channel A -evaluate set 60% \) -draw "image over 169,555 875,109 'img1.png'") but it didnt work, can someone help me please?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Help with transparency to a newbie
You can specify the color as hex with alpha values by adding two more characters or better you can use rgba(r,g,b,a) values in your command. See http://www.imagemagick.org/script/color.php
________________
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
________________
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
-
- Posts: 5
- Joined: 2018-07-20T18:29:45-07:00
- Authentication code: 1152
Re: Help with transparency to a newbie
I'm using ImageMagick 7 and writing like this really dont work, and i've looked through this page you sent before posting in here, where do i find a way to do it on ImageMagick 7? Can you be more specific? As i said i would like to set 70% transparency, thats allfmw42 wrote: ↑2018-07-20T19:12:46-07:00 You can specify the color as hex with alpha values by adding two more characters or better you can use rgba(r,g,b,a) values in your command. See http://www.imagemagick.org/script/color.php
________________
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
-
- Posts: 5
- Joined: 2018-07-20T18:29:45-07:00
- Authentication code: 1152
Re: Help with transparency to a newbie
Can't someone just say to me which line i write after the background to make it 70% transparent, please?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Help with transparency to a newbie
hrqmonteiro wrote: ↑2018-07-20T19:30:24-07:00 Can't someone just say to me which line i write after the background to make it 70% transparent, please?
what i wanted to do is to set the image to match my terminal, which uses the color #000 with 70% opacity
Hex #000 is black and the same as rgb(0,0,0). But you want to have it with 70% opacity.
Code: Select all
"rgba(0,0,0,0.7)"
-
- Posts: 5
- Joined: 2018-07-20T18:29:45-07:00
- Authentication code: 1152
Re: Help with transparency to a newbie
Didn't workfmw42 wrote: ↑2018-07-20T19:36:34-07:00hrqmonteiro wrote: ↑2018-07-20T19:30:24-07:00 Can't someone just say to me which line i write after the background to make it 70% transparent, please?what i wanted to do is to set the image to match my terminal, which uses the color #000 with 70% opacity
Hex #000 is black and the same as rgb(0,0,0). But you want to have it with 70% opacity.
keep the quotes in on Unix.Code: Select all
"rgba(0,0,0,0.7)"
-
- Posts: 5
- Joined: 2018-07-20T18:29:45-07:00
- Authentication code: 1152
Re: Help with transparency to a newbie
Man i just wanted it to match the colors... wouldnt it be possible?...
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Help with transparency to a newbie
If the background is not transparent enough, then change to
Note that if you are saving to JPG, JPG does not support transparency. You will need to save to PNG or TIFF.
Try these two simple commands. Do either give the background you want?
If that does not work, then please clarify exactly what you want changed and where.
Code: Select all
"rgba(0,0,0,0.3)"
Try these two simple commands. Do either give the background you want?
Code: Select all
convert rose: -gravity center -background "rgba(0,0,0,0.7)" -extent 150x150 result1.png
convert rose: -gravity center -background "rgba(0,0,0,0.3)" -extent 150x150 result2.png
If that does not work, then please clarify exactly what you want changed and where.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Help with transparency to a newbie
Are you sure you know exactly what the color is that you want to match?hrqmonteiro wrote: ↑2018-07-20T19:50:21-07:00 Man i just wanted it to match the colors... wouldnt it be possible?...
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Help with transparency to a newbie
I cannot read your screen snap very well. Did you use
rgbo(0,0,0,0.7) with an O after rgb
or
rgba(0,0,0.0.7) with an A after rgb
O is incorrect. A is correct.
rgbo(0,0,0,0.7) with an O after rgb
or
rgba(0,0,0.0.7) with an A after rgb
O is incorrect. A is correct.