Sign in to follow this  
jsonchiu

Bevel Plugin [v1.4, August 22]

Recommended Posts

Can you please make it a .zip file? I try to download it, but my CPU is having trouble doing it.

It doesn't have any problems with the .zip file though.

I'd really appreciate it. ;)

Share this post


Link to post
Share on other sites

look forward to seeing this doing the curves. keep up the great work I certainly appreciate the plug in makers, and value their fine work. :D .

Share this post


Link to post
Share on other sites

This may be a silly question, but would this bevel plugin provide a line around a person in a picture? I have seen it done in some Photoshop manips, and am trying to figure out how it's done. If a rounded bevel is it, I can't wait to try it! :D

Share this post


Link to post
Share on other sites
If you just want a regular solid line, you'd be better off using Pyrochild's Outline Object plugin.

I just tried using that particular plugin, and nothing happened. I first took a picture, then used the lasso to highlight the selected area. It rendered but nothing changed in the picture. Then I made a design and highlighted the area with a different color, ran the plugin again, and nothing happened. I am using 3.10 version.

Whoops! I think I figured this out. If there is a transparent area showing around your image/object that you want highlighted, then this plugin will create around it. Is this how it works?

Share this post


Link to post
Share on other sites

That's correct. Same with this plugin. :-)

(If you have any more questions about Outline Object, I'd suggest you ask them in that thread so we don't hijack this one. :-))

Share this post


Link to post
Share on other sites
That's correct. Same with this plugin. :-)

(If you have any more questions about Outline Object, I'd suggest you ask them in that thread so we don't hijack this one. :-))

Sorry, got off on a tangent, seeing that you had some insight on the Outline Plugin. :wink:

Share this post


Link to post
Share on other sites

Rounded bevel - beta 1.0 release.

Bevel-irregularshape.zip

3535_64dbb1a9da7f0da692b02af122242dca

Works well with small depth and single color (sort of a inner glow effect).

It of course works great with rectangular selection and circular selection with any colors.

I'm still trying to figure out how to blend the colors (so it transitions from highlight to shadow smoothly)

Also, anti-aliasing is another problem...

The code (pm if anybody would like to help)

int Amount1=7;	//[0,200]Depth
int Amount2=20;	//[0,100]Strength

System.Collections.ArrayList sin_arr = new System.Collections.ArrayList();
System.Collections.ArrayList cos_arr = new System.Collections.ArrayList();

void Render(Surface dst, Surface src, Rectangle rect)
{
   PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds);

   // Delete any of these lines you don't need
   Rectangle selection = this.EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();

   long CenterX = (long)(((selection.Right - selection.Left) / 2)+selection.Left);
   long CenterY = (long)(((selection.Bottom - selection.Top) / 2)+selection.Top);
   int left = (int)selection.Left;
   int top = (int)selection.Top;
   int right = (int)selection.Right;
   int bottom = (int)selection.Bottom;
   ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;
   ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor;
   int BrushWidth = (int)EnvironmentParameters.BrushWidth;

   ColorBgra CurrentPixel;

   if (cos_arr.Count == 0)
   {
   	for (int v = 0; v <= 360; v++)
   	{
   	    sin_arr.Add((float)Math.Sin((float)v * ((float)3.14159 / (float)180)));
   	    cos_arr.Add((float)Math.Cos((float)v * ((float)3.14159 / (float)180)));
   	}
   }

   for(int y = rect.Top; y < rect.Bottom; y++)
   {
       for (int x = rect.Left; x < rect.Right; x++)
       {
           if (selectionRegion.IsVisible(x, y))
           {
               CurrentPixel = src[x,y];
               //let's search for the nearest radius
               int prevX = -1;
               int prevY = -1;
               bool found = false;
               int max;
               float factor;
               for (int i = 1; i <= Amount1; i++)
               {
                   max = (int)Math.Ceiling((float)i * (float)3.14159) + 1;
                   factor = 360 / (float)max;
                   for (int m = 0; m <= max; m++)
                   {
                       int element = (int)Math.Floor(factor * (float)m);
                       int newX = (int)((float)cos_arr[element] * (float)i) + x;
                       int newY = (int)((float)sin_arr[element] * (float)i) + y;
                       if (newX != prevX || newY != prevY)
                       {
                           prevX = newX;
                           prevY = newY;
                           if (selectionRegion.IsVisible(prevX, prevY) == false)
                           {
                               found = true;
                               if (element > 315 || element < 125)
                               {
                                   CurrentPixel = transformPixel(i, CurrentPixel, SecondaryColor);
                               }
                               else
                               {
                                   CurrentPixel = transformPixel(i, CurrentPixel, PrimaryColor);
                               }
                               break;
                           }
                       }
                   }
                   if (found == true)
                   {
                       break;
                   }
               }

               dst[x,y] = CurrentPixel;
           }
       }
   }
}
ColorBgra transformPixel(float px_from_edge, ColorBgra CurrentPixel, ColorBgra NewColor)
{
   //set amount of background interference 0~1 (ie how much it blends to the background)
   float diff = (float)(0.05 + px_from_edge/Amount1);
   float strength = (float)((float)(100 - Amount2) / 100 + (float)0.35);
   diff = diff * strength;
   if (diff > 1)
   {
       diff = 1;
   }
   else if (diff < 0)
   {
       diff = 0;
   }

   //some vars just for convenience, more readable
   float div = diff + 1;
   float invrt_diff = 1 - diff;

   //we set the RGB to primary color if it is completely transparent (black is the default)
   //That should solve
   if (CurrentPixel.A == 0)
   {
       CurrentPixel.R = NewColor.R;
       CurrentPixel.G = NewColor.G;
       CurrentPixel.B = NewColor.B;
   }

   //and we are ready to color the pixels
   //ex: if 70% background interference
   //we have 70% of original color's R plus 30% of the new color's R
   CurrentPixel.R = (byte)((invrt_diff * (float)NewColor.R) + (diff * (float)CurrentPixel.R));
   CurrentPixel.G = (byte)((invrt_diff * (float)NewColor.G) + (diff * (float)CurrentPixel.G));
   CurrentPixel.B = (byte)((invrt_diff * (float)NewColor. + (diff * (float)CurrentPixel.);

   //transparency values need special manipulation to prevent bad-looking renders
   float temp = CurrentPixel.A + NewColor.A;
   if (temp > 255)
   {
       temp = 255;
   }
   temp = ((int)CurrentPixel.A + temp) / 2;
   if (CurrentPixel.A < 255)
   {
       temp = temp * (1 + (float)invrt_diff);
   }
   if (temp > 255)
   {
       temp = 255;
   }
   CurrentPixel.A = (byte)temp;

   //and we are done
   return CurrentPixel;
}

Share this post


Link to post
Share on other sites

Please post all updates on your 1st post for easy tracking. (also change the title)

Thanks.

Share this post


Link to post
Share on other sites

. as far as I can tell this plug in writer hasn't been around for quite awhile. checked and looks like last time he signed in was April 2008.

if you can't get this one to work try the one by Bolt Bait its in the stickied portion of plug ins. title is Selection Tools-Feather, Outline and Bevel.

ciao

OMA

Share this post


Link to post
Share on other sites
I cant download the plugin, I get some error page saying forbidden or somethinng.

Use the source code on the 1st post and put it in codelab, then build you own dll.

Share this post


Link to post
Share on other sites
I cant download the plugin, I get some error page saying forbidden or somethinng.

Use the source code on the 1st post and put it in codelab, then build you own dll.

Are you serious, I'm retarded when it comes to that stuff, heck, I'm retarded when it comes to most paint programs, but I use paint.net most of the time because its easyer then Gimp, PSP, Photoshop, Real Draw Pro (all of which I have).

Can someone just post a link please, I'm not very good at digging through forum pages or locating the right plug-in, half the time I end up downloading the wrong one.

[EDIT]

Ok I found the thread I think...I think I have all those plugsins already, but how to you make a bevel?

Share this post


Link to post
Share on other sites

We can't, it's a copy rights issue.

Unless jsonchiu Post it.

However, I just tried it again and the link is UP! Grab it while it's hot!

Share this post


Link to post
Share on other sites

Thanks got it. Ansd I have that other guys plugins but what he posted must be an updated version because I dont have a bevel tool...anyway, I got the download in this thread, guess I'll go install it and see what happens.

Share this post


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

Sign in to follow this