My wish was for the magic to create subtle glitter

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: My wish was for the magic to create subtle glitter

Post by anthony »

IM can do it, but no example on how to do it has been developed, YET.


Anyone here like to give this a go.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: My wish was for the magic to create subtle glitter

Post by Bonzo »

Needs a rethink and I can not delete this post !
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: My wish was for the magic to create subtle glitter

Post by anthony »

I have some star generators...
http://www.imagemagick.org/Usage/advanced/#stars
and it includes hints and ideas for a gilitter.

However the section needs to be re-done with some new examples basied on using two random images...
http://www.imagemagick.org/Usage/canvas/#random
and/or a FASTER way to generate random images using +noise poisson instead of a slow -fx function.

Basically the ideas need some exploration, and re-thinking. All of which takes time I just do not have.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: My wish was for the magic to create subtle glitter

Post by anthony »

I have been doing a few experiments with +noise.

I am not impressed. Not one item is just a pure noise image!

however I did get some interesting results.

Code: Select all

  +noise poisson  -> regular intervals  but only using 20 or so values
  +noise impulse  -> most at the color,   5% pegged to min/max
  +noise gaussian -> black:  mostly black  rest near black
                     Grey:  half black/white  40 unique
                     White: half white  1/3 black  rest random
  +noise uniform  -> half at color   rest around that color (up to 2/256 values)
  +noise laplacian -> black:  half black  half non-unique random
                      grey:  1/3 white 1/3 black  1/3 non-unique random
                      white: half white  half non-unique random
  +noise Multiplicative ->
                     white/grey: equal black and white   1% random
                     black:    no change remains black
Compare that with -fx 'random()' which gives purely random color values.

This was just by trying out the commands, I have not looked at the source!

That last is interesting as if you use it on a mask you will get a 1% dot pattern,
but only on the white areas of the mask!

Code: Select all

   convert  mask_image.png   +noise Multiplicative \
               -solarize 50% -colorspace gray -normalize \
               random_dots_in_shaped_area.png
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: My wish was for the magic to create subtle glitter

Post by Bonzo »

This was the result of my test, I was going to look at it again tonight. The glitter effect is not great.
Image


I used the noise operator as well, impulse gave the best effect.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: My wish was for the magic to create subtle glitter

Post by anthony »

You don't seem to grayscale the glitter.
You can also reduce the amount of glitter by a 1/3 if you extract one
color channel as a glitter mask.

Code: Select all

   convert  mask_image.png   +noise Multiplicative \
               -solarize 50%  -channel G -normalize -separate +channel \
               random_dots_in_shaped_area.png
I still think a better result (with a more varible intensity in the glitter dots) can be achieved using two pure random images. I'll have to look at at least expanding +noise to return a pure random image (as a FAST "-fx 'random()' " ).

Then you can use thresholds and composition to set exactly what percentage of 'glitter' you want, and even multiply it with a mask to 'shape', or even 'fade' the glitter around the edges.

After that some very light -blur, -normalize and -sigmoidal-contrast can be used to enlarge 'dots', (depending on intensity) and make a 'nicer' looking glitter.

I'lll repeat the above in the It's Full of Stars thread in 'MagickStudio'. Which is where this type of discussion has been discussed more fully.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply