How to create animated glitters with PHP and imagemagick

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
sabater_wb

How to create animated glitters with PHP and imagemagick

Post by sabater_wb »

Hy Guys,
After a lot of hours trying to create animated glitters, my last solution is this forum.
I wanna create something like the image bellow.

Image

I tried to use the code bellow, with the "stars" files replaced by others gifs, also created for this purpose.

Code: Select all

convert rose:   -compose Screen \
          \( -clone 0 stars1.gif -composite \) \
          \( -clone 0 stars2.gif -composite \) \
          \( -clone 0 stars3.gif -composite \) \
          -delete 0 -set delay 25 -layers Optimize rose_sparkle.gif
but, I did not have sucess.

I did this in php:

Code: Select all

<?

exec("D:/Arquiv~1/ImageMagick-6.4.3-Q16/convert.exe convert rose: -compose Screen -clone 0 stars1.gif -composite -clone 0 stars2.gif -composite -clone 0 stars3.gif -composite -delete 0 -set delay 25 -layers Optimize rose_sparkle.gif");

?>
I tried on localhost, with windows xp and apache.

The problem isn't with my server, because other simple codes works well.

Codes like:

Code: Select all

<?
exec("D:/Arquiv~1/ImageMagick-6.4.3-Q16/convert.exe koala.gif  -flip  flip.gif");
?>
and many others works very well.

Please, if somebody, knows how to do that effect using PHP and "exec()", please, give me some help. I thank.

thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to create animated glitters with PHP and imagemagick

Post by anthony »

You forgot the parenthesis! They are imporatant.

If you want to know what they do see IM Examples, Basics, parenthesis
http://www.imagemagick.org/Usage/basics/#parenthesis

As for glitter text, have a look at the examples in
All that Glitters...
http://www.imagemagick.org/Usage/anim_mods/#glitter
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
SebGrey

Re: How to create animated glitters with PHP and imagemagick

Post by SebGrey »

Tnx for help, Anthony. I had the same problem & now everything's o'k! :D
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to create animated glitters with PHP and imagemagick

Post by anthony »

I what to look at some glitter overlays, and also overlaps involving seeds limited to a certian area (both of which I call sparkles). the above stars on a rose image is actually an example of 'sparkle'

I also want to get really fancy with the creation of flares from a specific seed point, complete with flare ring and rotating rays. then look at combining multilple flares with different starting points (both in time and space) to create a really interesting effect!

For example a 'sparkle' the travels up the wizards wand, then flares, and dissolves into a number of small sparkle flares over an area. before repeating.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: How to create animated glitters with PHP and imagemagic

Post by agriz »

convert rose: -compose Screen \
\( -clone 0 stars1.gif -composite \) \
\( -clone 0 stars2.gif -composite \) \
\( -clone 0 stars3.gif -composite \) \
-delete 0 -set delay 25 -layers Optimize rose_sparkle.gif

This is working perfectly. But how to tile the glitter if the image is bigger?

convert rose: -compose Screen \
\( -clone 0 -tile stars1.gif -composite \) \
\( -clone 0 -tile stars2.gif -composite \) \
\( -clone 0 -tile stars3.gif -composite \) \
-delete 0 -set delay 25 -layers Optimize rose_sparkle.gif
is not working
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to create animated glitters with PHP and imagemagic

Post by fmw42 »

agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: How to create animated glitters with PHP and imagemagic

Post by agriz »

Can i get the resource usage?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to create animated glitters with PHP and imagemagic

Post by fmw42 »

agriz wrote:Can i get the resource usage?
Not sure what you are asking? Can you clarify?
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: How to create animated glitters with PHP and imagemagic

Post by agriz »

Just asking can track how much memory does this script uses?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to create animated glitters with PHP and imagemagic

Post by fmw42 »

agriz wrote:Just asking can track how much memory does this script uses?

What script? I am not sure how one would track memory usage?
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: How to create animated glitters with PHP and imagemagic

Post by agriz »

Any script.. just asked.. never mind!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to create animated glitters with PHP and imagemagic

Post by fmw42 »

agriz wrote:Any script.. just asked.. never mind!
Each script will use a different amount of memory depending upon the processing done and image sizes and numbers involved.
Post Reply