transparency
nor wrote:magick wrote:Use xc:black rather than xc:none.
This is not what I need!.. This just creates a black background and still it puts an opaque image on it. I need the transparent bg (wich I can get with xc:none or xc:transparent) and the drawn image (bg.png) should have 60% opacity...
Can this be done? Thanks.
- composite -dissolve 60% fg.png bg.png combined.png
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Refering to your original attempt using rgba(0,0,0,124), you can do it using a
'matte' color fill. matte uses the transparency valur of the -fill colro seeting to
seth the alpha channel of the filled area.
Note however that, as per SVG standards the alpha component of rgba() is a decimal number. EG: rgba(0,0,0, 0.6 )
convert rose: -fill "rgba(0,0,0,0.6)" -draw 'matte 0,0 reset' semi-trans-rose.png
If you want a black border around a semi-transparent black 'window', as you original example is impling, then just create such a rectangle, and add a black border
(you must use a "-compose Copy" setting to preserve the semi-transparency).
convert -size 64x64 xc:"rgba(0,0,0,0.6)" \
-bordercolor black -compose Copy -border 18x18 \
black_window.png
As with anything with IM, you can do just about anything. You just need to describe what you want exactly, rather than how you are attempting to do it.
'matte' color fill. matte uses the transparency valur of the -fill colro seeting to
seth the alpha channel of the filled area.
Note however that, as per SVG standards the alpha component of rgba() is a decimal number. EG: rgba(0,0,0, 0.6 )
convert rose: -fill "rgba(0,0,0,0.6)" -draw 'matte 0,0 reset' semi-trans-rose.png
If you want a black border around a semi-transparent black 'window', as you original example is impling, then just create such a rectangle, and add a black border
(you must use a "-compose Copy" setting to preserve the semi-transparency).
convert -size 64x64 xc:"rgba(0,0,0,0.6)" \
-bordercolor black -compose Copy -border 18x18 \
black_window.png
As with anything with IM, you can do just about anything. You just need to describe what you want exactly, rather than how you are attempting to do it.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/