how to create transparent nosie png?
how to create transparent nosie png?
pattern_grid.png
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: how to create transparent nosie png?
For a gradient or solid color image with transparency the best idea is to specify the color as a '#...' with alpha value component.
Generally the best way of generating complex transparency in an image is to generate a mask of the transparency wanted, and then use a CopyOpacity to transfer the mask into the color component.
For example see..
http://www.imagemagick.org/Usage/color_ ... _semitrans
http://www.imagemagick.org/Usage/canvas ... ransparent
http://www.imagemagick.org/Usage/compose/#copyopacity
Generally the best way of generating complex transparency in an image is to generate a mask of the transparency wanted, and then use a CopyOpacity to transfer the mask into the color component.
For example see..
http://www.imagemagick.org/Usage/color_ ... _semitrans
http://www.imagemagick.org/Usage/canvas ... ransparent
http://www.imagemagick.org/Usage/compose/#copyopacity
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: how to create transparent nosie png?
thanks , can you write down the code how to generate the first png (noise) and the third png (glid) ? they seems too hard for me , I test some ways but can not get the right result.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: how to create transparent nosie png?
1) Either
convert -size 128x128 gradient:navy-white -attenuate 2 +noise gaussian result1.png
or
convert -size 128x128 gradient:navy-white -evaluate gaussiannoise 2 result1.png
see http://www.imagemagick.org/Usage/canvas/#gradient
Note gradients can use any color definition (names or hex values or rgb or cmyk or hsl or hsb)
2) Either
convert -size 128x128 xc:"#BCEE6888" result2.png
or
convert -size 128x128 xc:"rgba(188, 238, 104, 0.5)" result2.png
see color definitions http://www.imagemagick.org/script/color.php
3) convert -size 256x128 \
\( gradient:lightslateblue-slateblue \) \
\( pattern:crosshatch \) \
\( -clone 1 +level 40,100% \) \
\( -clone 1 -negate \) \
-delete 1 -compose over -composite tmp4.png
This is just a composite of a color gradient with a crosshatch pattern using the negate of the crosshatch as a mask
change the 40 to a lower value in +level 40,100% will make the lines darker
see http://www.imagemagick.org/script/forma ... n-patterns
This is unix. Windows users see http://www.imagemagick.org/Usage/windows/ for difference in syntax.
convert -size 128x128 gradient:navy-white -attenuate 2 +noise gaussian result1.png
or
convert -size 128x128 gradient:navy-white -evaluate gaussiannoise 2 result1.png
see http://www.imagemagick.org/Usage/canvas/#gradient
Note gradients can use any color definition (names or hex values or rgb or cmyk or hsl or hsb)
2) Either
convert -size 128x128 xc:"#BCEE6888" result2.png
or
convert -size 128x128 xc:"rgba(188, 238, 104, 0.5)" result2.png
see color definitions http://www.imagemagick.org/script/color.php
3) convert -size 256x128 \
\( gradient:lightslateblue-slateblue \) \
\( pattern:crosshatch \) \
\( -clone 1 +level 40,100% \) \
\( -clone 1 -negate \) \
-delete 1 -compose over -composite tmp4.png
This is just a composite of a color gradient with a crosshatch pattern using the negate of the crosshatch as a mask
change the 40 to a lower value in +level 40,100% will make the lines darker
see http://www.imagemagick.org/script/forma ... n-patterns
This is unix. Windows users see http://www.imagemagick.org/Usage/windows/ for difference in syntax.
Re: how to create transparent nosie png?
Thank you ! very very great help !