Jump to content
How to Install Plugins ×

Shaped Gradient v1.5


n d

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

  • Like 1

ndeee2.png

Link to comment
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

ndeee2.png

Link to comment
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...

ndeee2.png

Link to comment
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.

ndeee2.png

Link to comment
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.

Link to comment
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.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
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

ndeee2.png

Link to comment
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

ndeee2.png

Link to comment
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... ;)

ndeee2.png

Link to comment
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.

ndeee2.png

Link to comment
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
CookiesSigPDN2.png
Link to comment
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.

ndeee2.png

Link to comment
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

ndeee2.png

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.

×
×
  • Create New...