# TR's Reverse Fisheye v1.0

## Recommended Posts

TechnoRobbo's Reverse Fisheye v1.0

Removes or reduces the fisheye distortion to produce a panoramic image.

This plugin was developed while assisting another user. It got some reps and downloads so I decided to publish it.

There were 2 algorithms I developed - Linear and Circular. Which one you use is up to you.

Jimee at en.wikipedia
Cezary Piwowarski

The Codelab Source Code (for programmers)

Hidden Content:

// Name: TR's ReverseFishEye
// Title: TR's ReverseFishEye - v1.0
// Author: TechnoRobbo
// URL: http://www.technorobbo.com

#region UICode
byte Amount1 = 0; // [1] Reverse Type|Linear|Circular
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{

Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
double CenterX = ((selection.Right - selection.Left) / 2)+selection.Left;
double CenterY= ((selection.Bottom - selection.Top) / 2)+selection.Top;

double offx ,offy ,u, v;

ColorBgra CurrentPixel;

if (Amount1==1){

for (float y = rect.Top; y < rect.Bottom; y++)
{
for (float x = rect.Left; x < rect.Right; x++)
{
//find direction and distance

u = (x - CenterX ) / CenterX ;
v = (y - CenterY ) / CenterY ;

double wide = Math.Sqrt(1 - v * v);
wide = wide * u * CenterX ;

offx =wide + CenterX;
offy =y;

CurrentPixel = src.GetBilinearSample((float)offx,(float)offy);
dst[(int)x,(int)y]=CurrentPixel;
}
}
}else{
for (float y = rect.Top; y < rect.Bottom; y++)
{
for (float x = rect.Left; x < rect.Right; x+=.5f)
{
//find direction and distance
double mymax = maxradx *  Math.Tan(dirz);
double maxfar = Math.Sqrt(CenterX * CenterX + mymax * mymax);
double normal =  howfar/maxfar;
offx = (float)(CenterX +  Math.Cos(dirz) * CenterX * normal);
offy = (float)(CenterY +  Math.Sin(dirz) * CenterY * normal);

CurrentPixel = src.GetBilinearSample((float)offx,(float)offy);
dst[(int)x,(int)y]=CurrentPixel;

}
}
}

}

The Plugin

ReverseFisheye.zip

PDN 3.5 version ReverseFisheye35.zip

Edited by TechnoRobbo

Go out there and be amazing. Have Fun, TR

Some Pretty Pictures Some Cool Plugins

##### Share on other sites

Nifty plugin!

Knowledge is no burden to carry.

April Jones, 2012

##### Share on other sites

Very interesting,,,hhhmmm,,,,already have some ideas for some other uses,,let you know how I make out.  Thanks TR

##### Share on other sites

• 2 years later...
• 4 years later...
Posted (edited)

NO  ,THAT IS THE ONE i DO  HAVE.. tHE ONE  i need keeps it fiheye effect as   .PING IMAGE ,AND  then I change its shape to my desired effect. I have downloaded  this fisheye but it will just not go into plugin effect. The other  ones did the same and oddly finally made it into effects. I don't know  why this fisheye is giving me so much trouble. It was in my plugins before. It is by far my favorite " fisheye " effect. But I will press on till I get it. Thanks Pixey.

By the way Pixey, do you develop and create plugins too?

Edited by Cakie67
##### Share on other sites

@Cakie67 If you have the Reversed Fisheye already, then it must be this one:

Are you sure you are putting the .dlls into the Effects Folder that you made after you downloaded the Store Bought version of Paint.net?  You know you had to make your own folder for them?

" a folder in Documents called "paint.net App Files" then a set of sub-folders including one called Effects."

1 hour ago, Cakie67 said:

By the way Pixey, do you develop and create plugins too?

No, I'm not into that - too much script and lines for me to digest 🤪

How I made Jennifer & Halle in Paint.net

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

##### Share on other sites

Yes dear. you are so sweet..,   I did everything Red Ochre told me to do. today i was making a  Desert art  design . just to see if everything was working like I need. Gridwarp would shut down my Paint.Net I lost everything  of my design and had to start over. Gridwarp  I got installed, but it does not work. I was completely lost in making this design without " Distort Fisheye, and Gridwarp and Reshape .dll. here is the design, title " Desert Dreaming".. I was playing around with BoltBaits new " effect Dream. I do like that.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×