Sign in to follow this  
Followers 0
wizard

Glass orb generator

43 posts in this topic

Hi all. I'm quite new to the Paint.NET plugins business, but do development for a living.

The first plugin I've tried to make is a generator for the glass orbs you see a lot nowadays, like this one:

PurpleOrb100x100.png

You can find a tutorial about how to make them by hand here.

Well, I won't keep you waiting, here's the download...Enjoy...

0

Share this post


Link to post
Share on other sites

And a little more blur on the top, imho...

But looks good! I'll try it out over the weekend!

EDIT: Or whenever I can download it from the link... :?

0

Share this post


Link to post
Share on other sites

Yeah, the bottom part of the orb really isn't very good in my tutorial, is it... v_v

0

Share this post


Link to post
Share on other sites

Strange...I tried the download myself yesterday night, and that worked fine. But, good to see that you all found a workaround.

Yeah, it's not great yet, but it's my first attempt on paint.net plugins and generating orbs.

Does anyone have an example of doing a blur? Is that easy to apply for just the highlight?

I'll try to see if I can make some like CJ's tutorial. I like those even more, but there a bit more work.

0

Share this post


Link to post
Share on other sites

Nice plugin, please put it in Render if you can & if that's the correct place :)

0

Share this post


Link to post
Share on other sites

wizard, look at this post:

http://paintdotnet.12.forumer.com/viewtopic.php?t=4085

You can use Blur just like I'm using Glow.

In fact, download the Paint.NET source code and look at the Pencil Sketch effect. It uses blur. That's what I patterned my effect after.

0

Share this post


Link to post
Share on other sites

this is pretty cool. but it does it based on the canvas size, if I do a selection it draws inside the selection but based on the canvas size so it draws the piece that would normally go if it was drawing on the full canvas.

And yes it is slow, I think if you post your source code, you can get some help on it, I THINK you are doing a for x then for y loop and thats why it is slow.

And yes if you can move it in render, it would be better, don't need another submenu for one item.

0

Share this post


Link to post
Share on other sites

Thanks BoltBait, I'll look into that deeper when I have some spare time :)

Here's a general question to other plugin developers:

My OrbGenerator works like this now:

I create a completely new bitmap, with the same size as the source Surface, derive Graphics from it, paint on it to create the orb, and then copy each pixel from my own Bitmap to the target Surface within the "for" loops shown in all the examples (and the Effect Template).

This is not really quick (as someone mentioned). I would like to be able to draw directly on the target surface. Is that possible? Does that have any side effects, like totally ignoring any existing selections?

0

Share this post


Link to post
Share on other sites

pdn splits the image into small rectangles and runs them in parallel, you are having it run thru each pixel of the entire image, every time it calls the render function on the smaller rectangle. I believe that is why its performing slow.

You can draw on the target surface directly. Look at the source code of some plugins posted here, and you can see how its done.

The render function includes 2 parameters which are RenderArgs dstArgs, RenderArgs srcArgs.

            Rectangle selection = this.EnvironmentParameters.GetSelection(srcArgs.Surface.Bounds).GetBoundsInt();

           // Loop through all the pixels

           for (int y = selection.Top; y < selection.Bottom; y++)
           {
               for (int x = selection.Left; x < selection.Right; x++)
               {
                   ColorBgra* srcPtr = srcArgs.Surface.GetPointAddress(x, y);
                   CurrentPixel = *srcPtr;
                   // you can use the current pixel and then set it on the target or destination surface
                   // and then set the target surface pixel to the that, this is just copying the pixel over.
                   *dstArgs.Surface.GetPointAddress(x, y) = CurrentPixel;
                  ....

Thanks BoltBait, I'll look into that deeper when I have some spare time :)

Here's a general question to other plugin developers:

My OrbGenerator works like this now:

I create a completely new bitmap, with the same size as the source Surface, derive Graphics from it, paint on it to create the orb, and then copy each pixel from my own Bitmap to the target Surface within the "for" loops shown in all the examples (and the Effect Template).

This is not really quick (as someone mentioned). I would like to be able to draw directly on the target surface. Is that possible? Does that have any side effects, like totally ignoring any existing selections?

0

Share this post


Link to post
Share on other sites

Hmmm, I dove into the way the Render method works, and finally grasped the idea :) Took a while...

Although it's excellently thought out for effects that alter the existing image, or those effects that draw a new image based on some translation of X and Y coordinates, it seems that the current method can't be used (efficiently) for the stuff I'm trying with my Orb Generator. My calculations are not based on X or Y coordinates, just on the size of the surface or users selection.

Anyway, I did find a way to fix this, although I'm not sure if this is how it should be done. I've created a static Bitmap variable, so I only draw the bitmap once onto that.

After that, during each Render call, it only copies the correct part to the target surface. That works like a charm.

Now I only have to find out how to determine the size of the complete user selection (since it still uses the size of the TargetSurface, and not the bounding rectangle of the users selection). Is that possible? (I found some requests on this topic, but couldn't find a good answer).

0

Share this post


Link to post
Share on other sites

I think its a great plug-in, but i dont like the bottom.

To remove the bottom, I have made a little guide(no pictures).

1. Select ALL pixels in the bottom circle(also the little grey ones around it), by using the magic wand at about 50%. Maybe its easier to use the ellipse seletion tool(depends on the orb color).

2. Move the selection(NOT the pixels) up, just then it dosn't select the circle edges(you'll have to move it a little to the left), and press CTRL+C.

3. Now press CTRL+V to paste the copied area, and place it on the bottom circle. It should cover the grey pixels perfectly, otherwise you should start over.

4. Go to adjustments>levels(CTRL+L), hit reset, and change the middle number in the output section from 1,00 to someting like 1,50(depends on the orb color).

5. Now use the feather plug-in, set to amount 1 and shrink, to soften the edge of the bottom circle(not necessary, but looks good).

You're done!

0

Share this post


Link to post
Share on other sites

@ Bjerre

i used a method much simpler. you can still see a little gray and it looks more like a pot than an orb. and, it changes the colors to a bit more dark.

1. duplicate image

2. on the top image, set blending mode to color burn

heres my "work"

after my mini tut:

bleh2orig.png

Touched up:

bleh2.png

0

Share this post


Link to post
Share on other sites

I like this render. I made a pool ball with it :D

PoolBall.png

I selected the coloured part, the bottom white part, recreated the gradient. Then I made another layer, writing "5" 25 pixels-ish from the bottom line of the top white part. Then I used MKT's Shape3D to make the "5" more asjusted to the pool ball. And there it is :)

Note:You need to have the exact same number of pixels for your height and your width.

Edit: I just saw the post above, and I like my method better 8)

0

Share this post


Link to post
Share on other sites

Nice plugin. This actually would look better if u used more blur but hey only my opinion.

0

Share this post


Link to post
Share on other sites

However, with blur... you wouldn't be able to do this:

th_OpenSphere.png

(I thumbnailed it, 'cause it was big.)

I selected the white to do this. However, with blurred edges, it's going to be a bit difficult.

Which is why I think that if our dear plug-in maker fixes it with a blur, he should make it so that we can have both the plug-ins. :)

0

Share this post


Link to post
Share on other sites

EDIT:

Wow! This is fantastic! I might try to make a new FX theme with this. Beautiful. Thanks!

This is great especially for a new guy :wink:

Wizard, I'd love to see you make some new plugins. Possibly one that makes iamges look brushed like in my tut :) nah JK but I would love to see some new ones because this is great for a first one.

EDIT:

Ahh! It doesn't work when you do it on a 8000 x 8000 px canvas.

0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0