Jump to content


Photo

Tube Effect (ymd: 100718)


45 replies to this topic

#21 MadJik

MadJik
  • Members
  • 2,428 posts
  • LocationLille;France
  • Reputation:21

Posted 03 May 2007 - 03:23 PM

I've always liked this plugin...

Would it be possible to center the effect? That way you wouldn't need to piece the image back together if part of it went of the canvas...


I don't see what you mean!
This effect is built to 'move' lines horizontaly (or columns verticaly), on a curve (half ellispe). So of course the image is wrapping...

Are you asking me to redo a 'sphere' effect?
  • 0

#22 barkbark00

barkbark00
  • Members
  • 3,336 posts
  • Reputation:3

Posted 03 May 2007 - 04:02 PM

Here is what I mean...

Before:
Posted Image

With Tube:
Posted Image

My idea:
Posted Image


Basically I would like the "Paneling" function be automatically done to re-center the image.
  • 0
Posted Image
Take responsibility for your own intelligence. ;) -Rick Brewster

#23 MadJik

MadJik
  • Members
  • 2,428 posts
  • LocationLille;France
  • Reputation:21

Posted 03 May 2007 - 07:21 PM

Ok I see...

I've tried something that should work:

What's new:
Third slider used for Centered No/Yes

Re-Download the Effect DLL
You can download the effect DLL here: Tube Oblique.dll

Put this file in your c:/program files/Paint.NET/Effects directory. You need to restart Paint.Net.
The Effect is in the Effects menu under Distorts...

int Amount1=0;  //[-500,500]Horizontal cylinder factor 
int Amount2=0;  //[-500,500]Vertical cylinder factor 
int Amount3=1;  //[0,1]Centered 0=No,1=Yes 

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

  long SizeX = (long)(selection.Right - selection.Left); 
  long SizeY = (long)(selection.Bottom - selection.Top); 
  long CenterX = (long)((SizeX / 2.0f)+selection.Left); 
  long CenterY = (long)((SizeY / 2.0f)+selection.Top); 
  ColorBgra CurrentPixel; 

  float RadiusY = -(float)(Amount1 * CenterY) / 100.0f; 
  float RadiusX =  (float)(Amount2 * CenterX) / 100.0f; 
  float Distort = 2.0f; 


  for(int y = rect.Top; y < rect.Bottom; y++) 
  { 
    for (int x = rect.Left; x < rect.Right; x++) 
    { 
      float AngleY = (float)Math.Asin(Distort *(float)(y - CenterY)/(float)SizeY); 
      float srcXd = (float)(Math.Cos(AngleY) * RadiusY - Amount3 * RadiusY); 
      float srcX = (float)Math.IEEERemainder(srcXd + x,SizeX); 
      if (srcX < selection.Left) srcX+=(int)SizeX; 
      if (srcX >= selection.Right) srcX-=(int)SizeX; 

      float AngleX = (float)Math.Acos(Distort *(float)(x - CenterX)/(float)SizeX); 
      float srcYd = (float)(Math.Sin(AngleX) * RadiusX - Amount3 * RadiusX); 
      float srcY = (float)Math.IEEERemainder(srcYd + y,SizeY); 
      if (srcY < selection.Top) srcY+=(int)SizeY; 
      if (srcY >= selection.Bottom) srcY-=(int)SizeY; 

      CurrentPixel = src.GetBilinearSample(srcX, srcY); 
      dst[x,y] = CurrentPixel; 
    } 
  } 
} 
Edit:
changed some int to float in the code
  • 0

#24 barkbark00

barkbark00
  • Members
  • 3,336 posts
  • Reputation:3

Posted 03 May 2007 - 08:23 PM

It works good.

What happened the to great sampling it use to have? :cry:

Not enough sliders?
  • 0
Posted Image
Take responsibility for your own intelligence. ;) -Rick Brewster

#25 BoltBait

BoltBait

    2013 Movie Guru Award Winner

  • Administrators
  • 9,630 posts
  • LocationCalifornia, USA
  • Reputation:325

Posted 03 May 2007 - 08:42 PM

The problem is, he is calling GetBilinearSample, but he is calling it with integers.
  • 0
Click to play:
Posted ImagePosted ImagePosted ImagePosted ImagePosted Image
Download: BoltBait's Plugin Pack | CodeLab | More... and how about a Computer Dominos Game

#26 OmgWtfBbq

OmgWtfBbq
  • Members
  • 195 posts
  • Reputation:0

Posted 04 May 2007 - 12:03 AM

LMFAO I just downloaded the second dll and then I realised we have a third >_>
  • 0

#27 MadJik

MadJik
  • Members
  • 2,428 posts
  • LocationLille;France
  • Reputation:21

Posted 04 May 2007 - 04:37 AM

The problem is, he is calling GetBilinearSample, but he is calling it with integers.


Thanks... I'm learning everyday!
I will change it soon!
  • 0

#28 MadJik

MadJik
  • Members
  • 2,428 posts
  • LocationLille;France
  • Reputation:21

Posted 04 May 2007 - 07:43 AM

Changed some int to float in the code on previous post.
Re-Download the DLL...
  • 0

#29 GradensMommy

GradensMommy
  • Members
  • 15 posts
  • Reputation:0

Posted 27 November 2007 - 08:21 AM

i try to DL this and it keeps telling me

this file does not have a program associated with it for performing this action. create an association in the set associations control panel

what does this mean??
  • 0

#30 MadJik

MadJik
  • Members
  • 2,428 posts
  • LocationLille;France
  • Reputation:21

Posted 27 November 2007 - 09:54 AM

i try to DL this and it keeps telling me

this file does not have a program associated with it for performing this action. create an association in the set associations control panel

what does this mean??

You could read on the first post of the topic, and few posts before yours:

Tube Effect
/.../
The Effect DLL

You can download the effect DLL here: Tube Oblique.dll

Put this file in your c:/program files/Paint.NET/Effects directory. You need to restart Paint.Net.
The Effect is in the Effects menu under Distorts...
/.../

The DLL file is a part of the program, and can't be opened...Follow the instructions please.
  • 0

#31 GradensMommy

GradensMommy
  • Members
  • 15 posts
  • Reputation:0

Posted 01 December 2007 - 06:18 AM

Well sorry for asking i didnt know what that ment thanks for putting it in english for my dumb ... ***rolls eyes***

i try to DL this and it keeps telling me

this file does not have a program associated with it for performing this action. create an association in the set associations control panel

what does this mean??

You could read on the first post of the topic, and few posts before yours:

Tube Effect
/.../
The Effect DLL

You can download the effect DLL here: Tube Oblique.dll

Put this file in your c:/program files/Paint.NET/Effects directory. You need to restart Paint.Net.
The Effect is in the Effects menu under Distorts...
/.../

The DLL file is a part of the program, and can't be opened...Follow the instructions please.


  • 0

#32 david.atwell

david.atwell

    2013 Real Estate Award Winner

  • Moderators
  • 1,694 posts
  • LocationIndianapolis, IN (39°46′5.88″N 86°9′29.52″W)
  • Reputation:198

Posted 01 December 2007 - 06:26 AM

Don't yell at MadJik because YOU didn't read. Come on - We're nice people, you can be, too. :-)
  • 0

stargatesig.png

The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.
Amy: But how did it end up in there?
The Doctor: You know fairy tales. A good wizard tricked it.
River Song: I hate good wizards in fairy tales; they always turn out to be him.


#33 MadJik

MadJik
  • Members
  • 2,428 posts
  • LocationLille;France
  • Reputation:21

Posted 01 December 2007 - 07:06 AM

@david.atwell: thanks...

@GradensMommy: Well, I thought you knew a bit about Files explorer in Windows...
From the Start button, find and open 'My computer'
Find and open C drive
Find and open 'Program files'
Find and open 'Paint.net'
Find and open 'Effects'
Now you are in your c:/program files/Paint.NET/Effects directory.

You have to move the downloaded file TubeOblique.dll in this folder. And restart Paint.net...

You should ask some help about this file handling around you (family, friends, etc...)
  • 0

#34 pyrochild

pyrochild
  • Administrators
  • 11,498 posts
  • LocationColorado
  • Reputation:205

Posted 17 December 2007 - 12:03 AM

This new version has a bug. Try running it with a selection that's not on the left edge of the image.
  • 0
xZYt6wl.png
ambigram signature by Kemaru

[I write plugins and stuff]

If you like a post, upvote it!

#35 GradensMommy

GradensMommy
  • Members
  • 15 posts
  • Reputation:0

Posted 22 December 2007 - 12:08 AM

@david.atwell: thanks...

@GradensMommy: Well, I thought you knew a bit about Files explorer in Windows...
From the Start button, find and open 'My computer'
Find and open C drive
Find and open 'Program files'
Find and open 'Paint.net'
Find and open 'Effects'
Now you are in your c:/program files/Paint.NET/Effects directory.

You have to move the downloaded file TubeOblique.dll in this folder. And restart Paint.net...

You should ask some help about this file handling around you (family, friends, etc...)



sry i was having a bad day that day........i figured it out after......thx though. :oops:
  • 0

#36 dolphinz770

dolphinz770
  • Members
  • 11 posts
  • Reputation:0

Posted 08 February 2008 - 09:46 PM

When I click on the download dll here link some error page comes up (in another language) am I doing something wrong? I was recommended this effect for when I do photo edits on "filmstrips". Please help, I am new at this Paint.net.
  • 0

#37 The_Lionhearted

The_Lionhearted
  • Members
  • 2,613 posts
  • LocationSpringfield, MO
  • Reputation:3

Posted 09 February 2008 - 02:30 AM

When I click on the download dll here link some error page comes up (in another language) am I doing something wrong? I was recommended this effect for when I do photo edits on "filmstrips". Please help, I am new at this Paint.net.

Link is broken...Madjik? Help? :(
  • 0

#38 MadJik

MadJik
  • Members
  • 2,428 posts
  • LocationLille;France
  • Reputation:21

Posted 09 February 2008 - 07:57 AM

This plugin is in the package... viewtopic.php?f=16&t=21592

The link is changed for a zip (instead the dll)...
http://jcljay.free.f...TubeOblique.zip
  • 0

#39 dolphinz770

dolphinz770
  • Members
  • 11 posts
  • Reputation:0

Posted 09 February 2008 - 04:00 PM

Thanks for the new link! I downloaded and added it to my effects. Tried it out and it worked :) Only problem is the tutorial i was using for the filmstrip just mentioned the horizontal and vertical access settings nothing about anti-aliasing and steps factor. Maybe that person had and older version? Anyway...I am attaching before and after of what happened when I tried it. It added dots at the top and cut off the bottom. I am sure some of you smarter people can tell me how to fix it.

Attached Images

  • Filmstrip_test.jpg
  • Filmstrip_test2_curved.jpg

  • 0

#40 dolphinz770

dolphinz770
  • Members
  • 11 posts
  • Reputation:0

Posted 09 February 2008 - 04:09 PM

Oops, I just realized I tried to attach a 3rd pic to show what it was supposed to look like but it didnt work b/c it was a BMP. Here it is as jpg thanks.

Attached Images

  • final product.jpg

  • 0