Jump to content

Sparkle! Plugins (v2.6; Updated: 10/31/2007)


kshotts
 Share

Recommended Posts

There are more than 3 sliders needed. So perhaps I should create a more complex UI (than from codelab) to include them...

You are invited to do so as I can't compile it with codelab when it has more than 3 sliders :wink: .

Have you integrated the stars from your lens flare attempts? This would definately be nice!

Work in progress...

Link to comment
Share on other sites

First of all, the initial idea belongs to kshotts: scanning the picture to find out the little shinning stars to add them some sparkles.

(and second, some of my words could be wrong/non sense, forgive my english if so!)

@kshotts: could you please link this to your first topic. (Or should I restart a new topic for my plugin? Let me know.)

I'm calling flaRe the circle and flaKe the star.

The effect is in the submenu Distort.

From the codelab of kshotts

and another code I'm working on,

I've made this plugin :

==> Here is the DLL <==

==> Here is the source of the DLL <==

____________________________________________

To install:

Close Paint.net

Unzip and (re)place the DLL in your Effect folder usualy: C:/Program Files/Paint.NET/Effects

____________________________________________

The user interface:

sparkleUI.png

__Brightness Threshold (20,255, default=100) increase the value to select only the brightest pixels.

__Maximum Glitter Size (0,200, default=50) maximum (if random checked) radius.

__Glitter Possibility (0,100, default=20) Possibility (0=none, 100=all) for a bright pixel to receive a glitter.

__Flare/Flake ratio (0,100, default=50) 0=only flares, 100=only flakes, other=ratio between flares & flakes.

__Flake normal/invert ratio (0,100, default=50) 0=only normals, 100=only inverts. Normals are brighter in the center.

__Flare normal/invert ratio (0,100, default=50) 0=only normals, 100=only inverts. Normals are brighter in the center.

__Flake number of vertices (0,400, default=8) Quantity of vertices for the flake (star).

__Flare number of vertices (0,400, default=0) Quantity of rays to draw for the flare (0=perfect circle).

__Random size (default=checked) if checked all glitters have a random radius up to the selected maximum size. Else they all have the same size to the maximum.

____________________________________________

Some examples:

Original model:

sparkles0.jpg

Only flakes:

sparkles1.jpg

Only flares:

sparkles2.jpg

Fireworks!

sparkles3.jpg

Shooting stars!

sparkles4.jpg

____________________________________________

Caviar:

sparkles5.jpg

____________________________________________

INFORMATION:

__The glitters are created from the top-left corner to the bottom-right corner. The last one overwrites the first one.

__A spot with a small radius is made with several pixels and each pixel of the spot could receive a glitter.

WARNING: Don't use this plugin with a white image or Brightness Threshold with a too small value:

each pixel is considered as bright the CPU will do tons of calculation!

So again, please save your work before trying any new plugin/setting...

Link to comment
Share on other sites

Wonderful, simply wonderful. :bmw:

Edit: There is one thing left...

As an addendum: In 3.10 there is a new class that provides access to the Effect submenu names. This way a plugin can refer to SubmenuNames.Blurs (or whatever, I forget exactly) instead of defining their own "Blurs" string. This way they will be placed into the appropriate, localized submenu name.

I think the new namespaces only include distort and blurs.

Well, Madjik, do you mind using the new classes? The best thing would be if you would find the time to change all of your plugins and reupload them... :?

I know this would be work... But please...

Link to comment
Share on other sites

First of all, the initial idea belongs to kshotts: scanning the picture to find out the little shinning stars to add them some sparkles.

(and second, some of my words could be wrong/non sense, forgive my english if so!)

@kshotts: could you please link this to your first topic. (Or should I restart a new topic for my plugin? Let me know.)

I'm calling flaRe the circle and flaKe the star.

...

I added a link and a copy of part of your post to the front page...

You can gaurantee I'm looking through your source code because I've been wanting to add more than three sliders to my UI too...! I think'd also be cool to be able to lump a lot of the options under one larger UI (i.e., one option could be: Glitter, Glow, Star, etc... that would determine the kind of effect... but maybe not... may be out of my league and time available!) I want to at least add a check box that can turn on/off the randomness, and maybe add additional options with regards to the shape of the sparkle.... lots of thoughts rolling around, not enough time to implement...

I do want to figure out how to make the firsttime indicator always reset to zero... if I could figure that out I've got a lot of other things I want to try, but until I get that right, I'm hesitant to build a lot of plugins that I'd have to go back and fix once I do figure out the solution..... Any one out there know a solution?

Beautiful examples, btw!

Link to comment
Share on other sites

I really, really, really like this plugin! ^_^ I've found it really entertaining, and it makes shooting stars look cool!

But you know what I would love even more? The ability to change the color of the sparkles. That would be awesome!!

P.S. This plugin has GOT to be stickied.

I can only speak for my own plugins - the glitter version does vary in color depending upon the source pixel (esp. if the threshold is set low, but that also comes at a significant increase in CPU time depending on your other settings). But once I figure out how to build a nice UI, it would be cool to have a color filter one could apply... or maybe I could even use the primary/secondary colors... that wouldn't require a new UI at the moment...

Link to comment
Share on other sites

RenderGlitterDialog.gif

Sparkle_Glitter.dll (version 2, 09/19/07)

Found under Render --> Glitter (replaces my previous Glitter plugin, so if you prefer that version, make a backup before downloading!), this plugin lets you generate glowing spheres, diamonds, and flares, with lots and lots of parameters (as evidenced in the above screenshot).

Here's an example image using each of the shapes (though not nearly each different combination of options):

GlitterExample2.jpg

A short description of each option:

Shape: Determines the shape of the glitter. Available shapes are circle, diamond, and two kinds of flares.

Threshold: As always, specifies the minimum value of any pixel (in R,G, or B, or A overall) before further processing occurs.

Maximum Size: Maximum size of the glitter

Minimum Size: Minimum size of the glitter. NOTE: If these two values are different, the system will generate a glitter with a random size between the minimum and the maximum. The only way to generate glitter of a consistent size is to make the two values equal.

Probability: For each pixel that is going to be processed, this is the probability it will be processed. For images with LOTS of pixels that'll be processed, use a low probability (like .010); for an image with only a few pixels that will be processed, use a high probability (like 20).

Brightness: Adjusts the brightness of the glitter, up to four times.

Blend Mode: Determines the type of blending used when rendering the glitter. Available modes: Overwrite, Add, Subtract, Multiply, and Average. "ADD" produces some of the best results, though "Ovewrite" can generate very cool results when using Circle shapes and large sizes (resulting image is similar to molecules... very cool). Subtract works best on bright content (otherwise the glitter isn't very visible). Multiply doesn't do a whole lot at the moment... and average does an average between the area and the glitter, not sure what this can be used for.

Seed: Determines the random # seed. Assuming the probability and the threshold aren't changed, you can modify brightness and other options without changing the arrangement of glitter by keeping this number the same.

Process Center Pixel: if checked, the center pixel is processed. This means that it is blended with itself. If the blend mode is Add or Subtract or Multiply, then the pixel is modified (Add produces a brighter pixel). Sometimes desirable, sometimes not.

Vary Size Based On Value: This varies the size of the glitter based upon the value of the pixel being processed (i.e., a bright pixel produces a brighter piece of glitter). If not checked, the glitter varies between Minimum size and Maximum size irregardless of value.

Important Note: Since some options can consume significant CPU time (if lots of glitter ends up being drawn), this plugin comes with a safety: it only renders if "Preview" is checked, or when "OK" is pressed. While this won't stop the plugin from consuming a lot of CPU with bad settings, it does at least prevent just accessing the plugin for the first time on any image from nuking the CPU. For this reason, Preview does not save its state - it must be checked each time it is used to enable real-time updates.

Have fun! Source code is coming soon as soon as I package it up into something nice (Thanks to Madjik for such excellent source code in his plugin... :-) ). (This is also re-posted on the first post)

Link to comment
Share on other sites

Lots of the credit goes to Madjik... His source code for his plugin helped immensely in building my own UI... Thanks Madjik! :-)

Of course, thank you, Madjik.

A new idea (only an idea!): Kshotts, you could merge all your glitter-related plugins into one, for example providing an UI with tabs. The reason is that I also like your first attemps, but I would like to see all of these glitter things together in one UI. Perhaps Madjik would be so kind and help you again, I know him for very professional UIs.

And to provide a "preview" checkbox is a good idea. Maybe you should look for speed optimizations, sometimes it gets very slow.

Good look and thank you again, I really like it. :D

Link to comment
Share on other sites

@kshotts, I've since used this plugin and it is extremely interesting. I'm really liking the output!

Here are a few points of corrective criticism:

First, the 'Brightness' option should be called 'Intensity'. Reason being, when the 'Blend Mode' is set to 'Subtract' the glitter isn't bright...

Second, would it be possible to make the 'Seed' option scrollable or maybe add a 'Random' button? I think that might be helpful. :D

RenderGlitterDialog.gif

A short description of each option:

...

Brightness: Adjusts the brightness of the glitter, up to four times.

...

Seed: Determines the random # seed. Assuming the probability and the threshold aren't changed, you can modify brightness and other options without changing the arrangement of glitter by keeping this number the same.

...

 

Take responsibility for your own intelligence. ;) -Rick Brewster

Link to comment
Share on other sites

barkbark00 said:

Second, would it be possible to make the 'Seed' option scrollable or maybe add a 'Random' button? I think that might be helpful.

I was just going to suggest that too. Other than that, this plugin has gotten a ton more advance, and ill be using this a ton from now on.

I'm still alive!

Link to comment
Share on other sites

@kshotts, I've since used this plugin and it is extremely interesting. I'm really liking the output!

Here are a few points of corrective criticism:

First, the 'Brightness' option should be called 'Intensity'. Reason being, when the 'Blend Mode' is set to 'Subtract' the glitter isn't bright...

Second, would it be possible to make the 'Seed' option scrollable or maybe add a 'Random' button? I think that might be helpful. :D

Thanks :-) I've updated the plugin, including these suggestions. Brightness is renamed Intensity, and Seed has a random button :-)

Link to comment
Share on other sites

Updated plugin to version 2.1, grab here: Sparkle_Glitter.dll (v2.1)

RenderGlitterDialog2.gif

Changes:

* Added additional shapes, including a 45 degree rotated flare, an eight-spoke flare (45 + 0 degree rotated flare), and a flare combo which picks 0 degree rotated flare 50% of the time and 45 degree rotated flare the other 50% of the time

Modified GUI

* Instead of the previous trackbars, the GUI uses an interface similar to Paint Shop Pro: the bar underneath the text box is a slider. It can be clicked/dragged to select values just like a trackbar. Also added a "rnd" button to many of the options - click to get a random number for the given control. (The only control without rnd is the probability control; this is to prevent the number generated being so high that the computer goes nuts trying to create the glitter)

* Seed gets the new slider control too, so you can randomly pick a seed, as well as select a specific seed.

* Added version/date string on the GUI so you can tell which version you've got

* Changed "Brightness" to "Intensity"

Anyone got suggestions for more shapes? Or any other suggestions are always appreciated, too :-)

Link to comment
Share on other sites

Hi kshotts,

Will the plugin generate the stars and flares over a completely black background?

Tried it without success. Wonder if it's a setting that I should learn.

At the moment the plugin needs something in the image to "source" the flares and stars. A completely black background pretty much has a zero threshold value, which means the plugin will never find source material to work with.

Try it with some random points on the background - you can use either the Stars codelab plugin in this forum (soon to be enhanced... :-) ), or the Add Noise effect; both should work. Or load a picture that has some high contrast so that you can see the effect easily. In all cases, keep the probability low, and if it renders nothing, ramp it up slowly... the higher the probability the more likely you'll freeze your computer while it thinks for every pixel in the image. You can also do the same with "threshold" - ramp it down slowly (again, same caveat applies).

Eventually I'd like to give the plugin the ability to generate its own flares without the need for source material, and also give it the ability to render just one shape in the selection, which would allow pin-point control over size and location of the flare.

Until then, see if the above helps... :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...