Hi!
Thank you for your time!
We are trying to replicate the inner glow filter of Flash AS3. We have an AS3 script that applies inner glow to an image. But we want to use the same parameters to be able to replicate in ImageMagick. Is that possible?
We are using the following script:
convert \( -size 778x1166 xc:none -fill '#bdbdbd' -draw 'rectangle 0,0,777 ,1165' \) \
\( -clone 0 -alpha extract \) \
\( -clone 0 -bordercolor red -border 40 -channel rgba -blur 15x65000 -shave 15x15 \) \
-delete 0 +swap -alpha off -compose copy_opacity -composite -auto-level -alpha off +level-colors red,white -alpha on b.jpg
The inner glow parameters from Flash are:
alpha = 1
color = 14695700
blurX = 61.2
blurY = 61.2
knockout = false
quality = 1
strength = 2
Out of these, only color, blurX and blurY are variable parameters in the as3 script. The rest remain the same.
Any help in this regard is welcome. Thank You!
replicating inner glow of flash
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: replicating inner glow of flash
I'm not sure what you are asking.
I last used Flash ActionScript about ten years ago, and I can't remember any details. If you want to replicate the action of an AS filter, please provide links to documentation and examples.
I last used Flash ActionScript about ten years ago, and I can't remember any details. If you want to replicate the action of an AS filter, please provide links to documentation and examples.
snibgo's IM pages: im.snibgo.com
Re: replicating inner glow of flash
Hi Snibgo,
Thank you for your reply!
We are trying to replicate the following filter of AS:
http://help.adobe.com/en_US/FlashPlatfo ... ilter.html
An example can be seen at the following link:
http://www.republicofcode.com/tutorials ... s3filters/
We are trying to replicate the glow filter.
Thank you!
Thank you for your reply!
We are trying to replicate the following filter of AS:
http://help.adobe.com/en_US/FlashPlatfo ... ilter.html
An example can be seen at the following link:
http://www.republicofcode.com/tutorials ... s3filters/
We are trying to replicate the glow filter.
Thank you!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: replicating inner glow of flash
From the Glow Filter part of the page:
Note that blur can be expressed in different way and the values may mean different things in IM than in your AS3. So you may have to figure out the relationship and put in some scaling factor to achieve the same amount from the same value.
From:
This tells me that the are not using the same method of blurring as in Imagemagick. They appear to be changing the size in steps to produce a ramp (linear?). IM's blur can be linear or gaussian in its roll-off.
So I imagine you may have to do some experimentation to get a similar result from IM with adjusted values. IM does not have any such quality argument in its blur.
Code: Select all
The Glow Filter has the following properties:
alpha - sets the transparency of the glow. Ranges from 0 to 1.
blurX - amount of horizontal blur in the glow.
blurY - amount of vertical blur in the glow.
color - the color of the blur in hex value.
inner - Set this to true to make the effect an inner glow.
knockout - Set this to true to knockout the original shape and keep the glow only.
quality - The number of glow duplicates used for the effect.
strength - The intensity of the glow. Ranges from 0 to 255.
From:
Code: Select all
quality - The number of glow duplicates used for the effect.
So I imagine you may have to do some experimentation to get a similar result from IM with adjusted values. IM does not have any such quality argument in its blur.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: replicating inner glow of flash
Here is my attempt in unix syntax. I am not sure this will duplicate your AS3 since I do not have that to test.
Input:
Input:
Code: Select all
quality=2
blur=10
glowcolor="black"
intensity=0
convert filters-removed.gif \
\( -clone 0 -fuzz 10% -fill white -opaque white \
-fill black +opaque white -write mpr:mask1 -negate \
-morphology erode square:$quality -blur ${blur}x65000 +level ${intensity}x100% -write mpr:mask2 +delete \) \
\( mpr:mask1 mpr:mask2 -compose plus -composite -compose over \) \
-alpha off -compose copy_opacity -composite \
-compose over -background $glowcolor -flatten result_q${quality}_b${blur}_g${glowcolor}_i${intensity}.png
Code: Select all
quality=5
blur=10
glowcolor="black"
intensity=0
convert filters-removed.gif \
\( -clone 0 -fuzz 10% -fill white -opaque white \
-fill black +opaque white -write mpr:mask1 -negate \
-morphology erode square:$quality -blur ${blur}x65000 +level ${intensity}x100% -write mpr:mask2 +delete \) \
\( mpr:mask1 mpr:mask2 -compose plus -composite -compose over \) \
-alpha off -compose copy_opacity -composite \
-compose over -background $glowcolor -flatten result_q${quality}_b${blur}_g${glowcolor}_i${intensity}.png
Code: Select all
quality=10
blur=10
glowcolor="black"
intensity=0
convert filters-removed.gif \
\( -clone 0 -fuzz 10% -fill white -opaque white \
-fill black +opaque white -write mpr:mask1 -negate \
-morphology erode square:$quality -blur ${blur}x65000 +level ${intensity}x100% -write mpr:mask2 +delete \) \
\( mpr:mask1 mpr:mask2 -compose plus -composite -compose over \) \
-alpha off -compose copy_opacity -composite \
-compose over -background $glowcolor -flatten result_q${quality}_b${blur}_g${glowcolor}_i${intensity}.png
Code: Select all
quality=10
blur=10
glowcolor="black"
intensity=50
convert filters-removed.gif \
\( -clone 0 -fuzz 10% -fill white -opaque white \
-fill black +opaque white -write mpr:mask1 -negate \
-morphology erode square:$quality -blur ${blur}x65000 +level ${intensity}x100% -write mpr:mask2 +delete \) \
\( mpr:mask1 mpr:mask2 -compose plus -composite -compose over \) \
-alpha off -compose copy_opacity -composite \
-compose over -background $glowcolor -flatten result_q${quality}_b${blur}_g${glowcolor}_i${intensity}.png