Page 1 of 1

how to create transparent nosie png?

Posted: 2011-07-02T03:00:31-07:00
by linjuming
Image

Image

pattern_grid.png
Image

Re: how to create transparent nosie png?

Posted: 2011-07-02T03:38:25-07:00
by anthony
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

Re: how to create transparent nosie png?

Posted: 2011-07-02T07:32:32-07:00
by linjuming
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.

Image

Re: how to create transparent nosie png?

Posted: 2011-07-02T11:14:51-07:00
by fmw42
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.

Re: how to create transparent nosie png?

Posted: 2011-07-02T18:01:28-07:00
by linjuming
Thank you ! very very great help !

Re: how to create transparent nosie png?

Posted: 2011-07-02T18:20:44-07:00
by fmw42
Glad to help