Sign in to follow this  
n d

Shaped Gradient v1.5

Recommended Posts

Paint net gradients are good. You can make them round, square, conical, linear... but what if you want, say, an elliptic gradient? A trapezoid gradient? A hexagonal gradient? Or a gradient in the shape of a christmas tree?

All this can be done with Shaped Gradient 1.5

Version history

version 1.5: fixed a bug with the center point selector.

version 1.4: added center point control. You can now choose the center point of the gradient.

version 1.2: added alpha control. You can now choose the alpha (transparency) for the edge & center colours separately.

TO-DO list:

- add anti-alias function

- add center-point control - done

- possibly: curve control for the gradient

Samples of the effect:

shapesample.png

pdngreat.png

Enjoy!

shapegradient.zip

Edited by Ego Eram Reputo
Added zipped *.dll

Share this post


Link to post
Share on other sites

Glad you all like it! :mrgreen:

You, my friend, have earned my respect.

:D

anyway to make the gradient smoother, by chance?

I have tried to implement an anti-alias feature, but so far I haven't been able to figure out how to do it. Perhaps in a future update, when I have gained a bit more C# experience...

As a workaround, you can do this:

- duplicate layer

- on the new layer, apply eigen blur with radius 1, RGB only

- set the new layer opacity to somewhere around 180-230

- merge layers

Share this post


Link to post
Share on other sites

Eh?

What would it adjust? There's no static angle involved... The gradient goes towards the center of the selection, so the angle varies with each pixel...

Share this post


Link to post
Share on other sites

Gives a really cool effect, but definitely misses an anti-alias option.. which gives me an idea!

Which doesn't make sense now that I thought of it. Lightrays already does that :|

Share this post


Link to post
Share on other sites

Anyway, as to not further derail the thread, here's a little update with alpha-adjustment added. It may or may not help with the aliasing problem somewhat, depending on the situation...

Note that it will still overwrite anything on the layer you use it on, so if you set an alpha value to 0 it will make that part of your layer transparent. So always apply the effect on an empty layer.

Shaped Gradient 1.2

NOTE: the dll name is now shapegradient.dll without the version number, so you need to delete the old .dll if you don't want two shapedgradients in your menu. Sorry for the inconvenience, but this was done to make further updates easier for me & you. I'm still learning this stuff, please don't crucify me for it.

Share this post


Link to post
Share on other sites

Thanks for the update. :)

I think that the question re: adjustable angle might be restated as can there be an option to

adjust the center point of the gradient effect instead of only the default center of the selection.

Again, as a non-coder myself, I don't know what would be involved in this.

I can make it happen through a work-around, but it's fairly laborious.

Share this post


Link to post
Share on other sites

YAY FOR DELETING STUPID POSTS OF A STUPID ARGUMENT THAT DOESN'T EVEN MAKE ANY STUPID SENSE IN THE FIRST PLACE.

Seriously. What the hell.

Share this post


Link to post
Share on other sites

Thanks for the update. :)

I think that the question re: adjustable angle might be restated as can there be an option to

adjust the center point of the gradient effect instead of only the default center of the selection.

Again, as a non-coder myself, I don't know what would be involved in this.

I can make it happen through a work-around, but it's fairly laborious.

Oh, so it's about adjusting the center point? I am going to add that - hopefully to the next version - I even have most of the code for it, but it still has a few glitches I need to work out.

I'm not going to do it with an angle control though - I was thinking more on the lines of X,Y vector controls.

ps - thanks for cleaning the thread pyro :)

Edited by n d

Share this post


Link to post
Share on other sites

v1.3 beta:

http://www.fileden.c...gradient1_3.zip

This has a functional center point selector, but the effect runs a bit slow now. So if you have a really slow computer and don't need the center-selection feature, stick to the previous version until I manage to optimize the code somehow. For this reason I'm keeping the previous version at the top post for now.

Edited by n d

Share this post


Link to post
Share on other sites

Thank you for creating this wonderful plug in .. This is what I came up with :mrgreen:

th_PurpleSG.png

Wow, that looks nice. And thanks.

Also, just to let everyone know, I've been a bit busy with other things, but I'm working on rewriting the code of v1.3 and I have some ideas how to make it faster... I also have a few ideas I'm going to try that could be used to implement an anti-alias function. Stay tuned... ;)

Share this post


Link to post
Share on other sites

Ok I updated the first post with version 1.4. It's the same as 1.3 but it should be at least marginally faster. I will continue to optimize the code as I get better at coding C#.

Still haven't been able to tackle the anti-alias issue, sorry for that. I'll keep working on it.

Share this post


Link to post
Share on other sites

Got a little bug when i tried the new version

Screenshot of it

screenshot36m.jpg

Edit: the centerpoint isn't centered when the double vector is 0.0, 0.0

Edited by Cookies

Share this post


Link to post
Share on other sites

Odd.

Are you sure you didn't have any stray pixels selected? Because the double vector is apparently relative to the selection, ie. 0,0 = center of the selection.

Share this post


Link to post
Share on other sites

Ah, it was a simple thing after all. I forgot to add the offset of the selection to the centerpoint calculation.

The center point selection now works as it should, ie. 0,0 = center of the selection.

The coordinates are still relative to the selection, if you need the center point to be outside the selection you'll need to select a few pixels in the corners to give a larger selection. If this is a problem to anyone, let me know and I'll try to find out how to acquire the canvas size to a plugin...

Anywho,

Version 1.5

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this