Page 2 of 2

Re: Metallic effect

Posted: 2013-09-29T20:38:47-07:00
by anthony
Snibgo... why the two separate blurs on the inptu text? I understand one blur, or even a linear blur, but not the two blurs.

Re: Metallic effect

Posted: 2013-09-30T05:55:51-07:00
by snibgo
I was replicating the steps from the Gimp tutorial in the OP, showing how each step could be implemented in IM.

Re: Metallic effect

Posted: 2013-09-30T17:08:23-07:00
by anthony
Okay. Just wondering if you did it to get a specific edge gradient style or something.

I have placed the example in IM Examples, Compound Fonts, at the very bottom
http://www.imagemagick.org/Usage/fonts/#metalic

Re: Metallic effect

Posted: 2013-09-30T18:03:36-07:00
by snibgo
The idea in the Gimp tutorial was that the first blur rounds the ends of the letters. The level could be a threshold. For the metallic effect, the important part is the second blur (added to whatever blur effect remains after the "level").

Since writing that script, I have realised that it doesn't need "identify" to find the size. I used that for the "gradient:", which needs "-size", but instead I can clone the image and use

Code: Select all

-sparse-color Bilinear "0,0 White %%[fx:w-1],0 White 0,%%[fx:h-1] Black %%[fx:w-1],%%[fx:h-1] Black"

Re: Metallic effect

Posted: 2013-09-30T19:54:27-07:00
by anthony
snibgo wrote:The idea in the Gimp tutorial was that the first blur rounds the ends of the letters. The level could be a threshold. For the metallic effect, the important part is the second blur (added to whatever blur effect remains after the "level").
Okay I understand. it is simply a rounding blur and threshold (using level) followed by the actual blur for the metalllic effect.

Of course some fonts do not need that first 'rounding effect'.

Hmmm increasing that initial rounding effect, could make a animation that causes the text to look like it is melting and puddling into one large blob!
snibgo wrote:Since writing that script, I have realised that it doesn't need "identify" to find the size. I used that for the "gradient:", which needs "-size", but instead I can clone the image and use

Code: Select all

-sparse-color Bilinear "0,0 White %%[fx:w-1],0 White 0,%%[fx:h-1] Black %%[fx:w-1],%%[fx:h-1] Black"

IMv7 can already to directly set -size from an existing image

You could have used Barycentric with only three point.

Or even only two points. -sparse color will automatically calculate a perpendicular third point for barycentric gradients
making linear gradients much easier.

Code: Select all

-sparse-colors Barycentric "0,0 White  0,%[fx:h-1] Black"

Also I find using shaped masks a lot easier to work with than having to mask results constantally using CopyOpacity,
The -alpha operators make using shaped masks a lot easier than you would expect. The only problem with them are alpha channel adjustments using -level

Okay updated the IM Example of this effect to....

Code: Select all

# Generate a blured input font shaped mask
# first blur-level is a rounding or 'puddling' effect
# the second blur is the important one for the metallic effect.
convert -background none -pointsize 160 -font Candice label:" Anthony " \
        -blur 0x5 -channel A -level 40%,60% +channel \
        -blur 0x3    metallic_input.png

# Metallic Color Lookup Table
convert \
  -size 1x1000 gradient:  -gamma 0.9 \
  -function Sinusoid 2.25,0,0.5,0.5 \
  \( gradient:'rgb(100%,100%,80%)-black' -gamma 1 \) \
  +swap \
  -compose Overlay -composite \
  -rotate 90 \
  metallic_clut.png

# Give blurred font a metallic look
#  * first create a vertial gradient
#  * then merge this with a 'shade' reflective gradient
#  * before applying the color to the resulting gradient
#  * finally add a shadow.
convert metallic_input.png -set colorspace RGB \
  \( -clone 0 -alpha off \
     -sparse-color Barycentric "0,0 White  0,%[fx:h-1] Black" \
     -alpha on \
  \) \
  \( -clone 0 -alpha extract -shade 135x45 -auto-gamma -auto-level \
     -alpha on -channel A -level 0%x10% +channel \
  \) \
  -delete 0 -compose Overlay -composite \
  metallic_clut.png -clut  -set colorspace sRGB \
  \
  \( +clone -background navy -shadow 80x2+5+5 \
  \) +swap -background None -compose Over -layers merge \
  \
  -trim +repage metallic.png
The -set colorspace sRGB is needed to make a on screen "display" result the same as the one that appears in a web browser. (image will appear in a few hours)
Image


Hmmm I probably should move the 'Aqua' Effect' techniaue that is in advanced to 'Compound fonts'.

Re: Metallic effect

Posted: 2018-02-01T18:42:06-07:00
by takwing1hk
can this be done via php without calling the convert executable?

Re: Metallic effect

Posted: 2018-02-01T19:26:39-07:00
by fmw42
You can likely do it with Imagick. But it calls ImageMagick. What do you mean without the convert executable. Do you mean no use of ImageMagick at all? Do you mean using only PHP and HTML5 and such. If the latter, then you should ask your question on another forum, since people on this forum are not specialists in such other tools.