transform an image: invert in a circle

E
Posted By
edgar
Mar 19, 2007
Views
1655
Replies
9
Status
Closed
Photoshop has certain transformations that can be applied to an image. And you can apply several of them, one after another. Can we arrange "inversion in a circle" as such a combination?

The existing transformations:

€ Scaling enlarges or reduces an item relative to its reference point. You can scale horizontally, vertically, or both horizontally and vertically.
€ Rotating turns an item around a reference point. By default, this point is at the center of the object; however, you can move it to another location.
€ Skewing lets you slant an item vertically and horizontally. € Distorting lets you stretch an item in all directions. € Applying perspective lets you apply one-point perspective to an item.

Inversion in a circle is described here:
http://en.wikipedia.org/wiki/Inversive_geometry


G. A. Edgar http://www.math.ohio-state.edu/~edgar/

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

R
ronviers
Mar 19, 2007
On Mar 19, 12:35 pm, "G. A. Edgar"
wrote:
Photoshop has certain transformations that can be applied to an image. And you can apply several of them, one after another. Can we arrange "inversion in a circle" as such a combination?

G. A. Edgar http://www.math.ohio-state.edu/~edgar/

Hi,
I don’t really understand what you’re asking – what combination? Do you want to create a circle tangent to an arbitrary point inside a given circle such that the new circle has a radius of square the original radius with a center on the line that intersects the arbitrary point and the center of the original circle?
If this is what you are trying to do then I can tell you how to do it in PS but you really should be using Illustrator for this because it allows you to enter expressions instead of just values as in PS, plus in PS it takes quite a few steps.

Good luck,
Ron
U
ullrich
Mar 20, 2007
On Mon, 19 Mar 2007 13:35:59 -0400, "G. A. Edgar" wrote:

Photoshop has certain transformations that can be applied to an image. And you can apply several of them, one after another. Can we arrange "inversion in a circle" as such a combination?
The existing transformations:

€ Scaling enlarges or reduces an item relative to its reference point. You can scale horizontally, vertically, or both horizontally and vertically.
€ Rotating turns an item around a reference point. By default, this point is at the center of the object; however, you can move it to another location.
€ Skewing lets you slant an item vertically and horizontally. € Distorting lets you stretch an item in all directions. € Applying perspective lets you apply one-point perspective to an item.

What’s the definition of "apply one-point perspective"?

Inversion in a circle is described here:
http://en.wikipedia.org/wiki/Inversive_geometry

************************

David C. Ullrich
E
edgar
Mar 20, 2007
In article ,
<""> wrote:

On Mar 19, 12:35 pm, "G. A. Edgar"
wrote:
Photoshop has certain transformations that can be applied to an image. And you can apply several of them, one after another. Can we arrange "inversion in a circle" as such a combination?

G. A. Edgar
http://www.math.ohio-state.edu/~edgar/

Hi,
I don’t really understand what you’re asking – what combination? Do you want to create a circle tangent to an arbitrary point inside a given circle such that the new circle has a radius of square the original radius with a center on the line that intersects the arbitrary point and the center of the original circle?
If this is what you are trying to do then I can tell you how to do it in PS but you really should be using Illustrator for this because it allows you to enter expressions instead of just values as in PS, plus in PS it takes quite a few steps.

Good luck,
Ron

I want to start with an image. And a circle. Do some transformations. End up with a new image, which is the inversion of the original image in the circle.


G. A. Edgar http://www.math.ohio-state.edu/~edgar/
R
ronviers
Mar 20, 2007
On Mar 20, 10:21 am, "G. A. Edgar"
wrote:

I want to start with an image. And a circle. Do some transformations. End up with a new image, which is the inversion of the original image in the circle.


G. A. Edgar http://www.math.ohio-state.edu/~edgar/

Like looking through a convex lens past its focal point? If so you could place a circle (elliptical marquee with shift to constrain) then copy (or copy merged), paste, flip horizontal, flip vertical, merge. You can use the spherize filter before merging if you want it to look like a magnifying glass. The next version of Photoshop will be better for this kind of thing because it allow smart filters. With smart filters you could move the area of distortion around in a nondestructive way.

Good luck,
Ron
GH
Gernot Hoffmann
Mar 20, 2007

G. A. Edgar schrieb:

Photoshop has certain transformations that can be applied to an image. And you can apply several of them, one after another. Can we arrange "inversion in a circle" as such a combination?
The existing transformations:

€ Scaling enlarges or reduces an item relative to its reference point. You can scale horizontally, vertically, or both horizontally and vertically.
€ Rotating turns an item around a reference point. By default, this point is at the center of the object; however, you can move it to another location.
€ Skewing lets you slant an item vertically and horizontally. € Distorting lets you stretch an item in all directions. € Applying perspective lets you apply one-point perspective to an item.

Inversion in a circle is described here:
http://en.wikipedia.org/wiki/Inversive_geometry


G. A. Edgar http://www.math.ohio-state.edu/~edgar/

The ‘inversion in a circle’ can be interpreted as
a hyperbolic reflection:
r’=(1/r)*R2

R2 means R^2
x2 means x^2
y2 means y^2

In cartesian coordinates, with c=cos(phi) and s=sin(phi): x’=r’*c
y’=r’*s
x=r*c
y=r*s
r=Sqrt(x*x+y*y)
x’=(1/r)*R2*c=(x/(x2+y2))*R2 (1)
y’=(1/r)*R2*s=(y/(x2+y2))*R2 (2)

A general planar perspective projection contains a
general affine projection (the first four items in the OP’s list, which are shown in my browser by Euro-like bullets), and the truly perspective part:

x’=(a0+ax*x+ay*y)/(c0+cx*x+cy*y) (3)
y’=(b0+bx*x+by*y)/(c0+cx*x+cy*y) (4)

One of the coefficients can be normalized to one,
for instance c0 in many cases.

Comparing (1) and (3), it’s obvious that (1) cannot be
simulated or replaced by (3), and so on.

Anyway wasted time: Photoshop is FOR THE USER not
based on mathematical descriptions.

Best regards –Gernot Hoffmann
K
KatWoman
Mar 20, 2007
wrote in message

G. A. Edgar schrieb:

Photoshop has certain transformations that can be applied to an image. And you can apply several of them, one after another. Can we arrange "inversion in a circle" as such a combination?
The existing transformations:

? Scaling enlarges or reduces an item relative to its reference point. You can scale horizontally, vertically, or both horizontally and vertically.
? Rotating turns an item around a reference point. By default, this point is at the center of the object; however, you can move it to another location.
? Skewing lets you slant an item vertically and horizontally. ? Distorting lets you stretch an item in all directions. ? Applying perspective lets you apply one-point perspective to an item.

Inversion in a circle is described here:
http://en.wikipedia.org/wiki/Inversive_geometry


G. A. Edgar
http://www.math.ohio-state.edu/~edgar/

The ‘inversion in a circle’ can be interpreted as
a hyperbolic reflection:
r’=(1/r)*R2

R2 means R^2
x2 means x^2
y2 means y^2

In cartesian coordinates, with c=cos(phi) and s=sin(phi): x’=r’*c
y’=r’*s
x=r*c
y=r*s
r=Sqrt(x*x+y*y)
x’=(1/r)*R2*c=(x/(x2+y2))*R2 (1)
y’=(1/r)*R2*s=(y/(x2+y2))*R2 (2)

A general planar perspective projection contains a
general affine projection (the first four items in the OP’s list, which are shown in my browser by Euro-like bullets), and the truly perspective part:

x’=(a0+ax*x+ay*y)/(c0+cx*x+cy*y) (3)
y’=(b0+bx*x+by*y)/(c0+cx*x+cy*y) (4)

One of the coefficients can be normalized to one,
for instance c0 in many cases.

Comparing (1) and (3), it’s obvious that (1) cannot be
simulated or replaced by (3), and so on.

Anyway wasted time: Photoshop is FOR THE USER not
based on mathematical descriptions.

Best regards –Gernot Hoffmann\

WHEW>>>sound of this discussion flying right over my head!!
R
ronviers
Mar 20, 2007
On Mar 20, 2:31 pm, "KatWoman"
wrote:
wrote in message

G. A. Edgar schrieb:

Photoshop has certain transformations that can be applied to an image. And you can apply several of them, one after another. Can we arrange "inversion in a circle" as such a combination?

The existing transformations:

? Scaling enlarges or reduces an item relative to its reference point. You can scale horizontally, vertically, or both horizontally and vertically.
? Rotating turns an item around a reference point. By default, this point is at the center of the object; however, you can move it to another location.
? Skewing lets you slant an item vertically and horizontally. ? Distorting lets you stretch an item in all directions. ? Applying perspective lets you apply one-point perspective to an item.

Inversion in a circle is described here:
http://en.wikipedia.org/wiki/Inversive_geometry


G. A. Edgar
http://www.math.ohio-state.edu/~edgar/

The ‘inversion in a circle’ can be interpreted as
a hyperbolic reflection:
r’=(1/r)*R2

R2 means R^2
x2 means x^2
y2 means y^2

In cartesian coordinates, with c=cos(phi) and s=sin(phi): x’=r’*c
y’=r’*s
x=r*c
y=r*s
r=Sqrt(x*x+y*y)
x’=(1/r)*R2*c=(x/(x2+y2))*R2 (1)
y’=(1/r)*R2*s=(y/(x2+y2))*R2 (2)

A general planar perspective projection contains a
general affine projection (the first four items in the OP’s list, which are shown in my browser by Euro-like bullets), and the truly perspective part:

x’=(a0+ax*x+ay*y)/(c0+cx*x+cy*y) (3)
y’=(b0+bx*x+by*y)/(c0+cx*x+cy*y) (4)

One of the coefficients can be normalized to one,
for instance c0 in many cases.

Comparing (1) and (3), it’s obvious that (1) cannot be
simulated or replaced by (3), and so on.

Anyway wasted time: Photoshop is FOR THE USER not
based on mathematical descriptions.

Best regards –Gernot Hoffmann\

WHEW>>>sound of this discussion flying right over my head!!

It is over my head too (obviously) but I thought that maybe the OP was a busy math prof. that just wanted to do something simple with PS and did not have time to mess with it. More likely he or she is a math prof. with plenty of spare time and far more PS expertise than I will ever have and wants to have his post grads rewrite PS to be some kind of astronomical optical guidance program for a research project.
MR
Mike Russell
Mar 21, 2007
"G. A. Edgar" wrote in message
….
I want to start with an image. And a circle. Do some transformations. End up with a new image, which is the inversion of the original image in the circle.

Gernot is correct that Photoshop itself cannot deliver what you are asking for.

If you can get some programming to bear on the subject, the simplest way to accomplish this would be to create a displacement map that defines the inversion as a 2d mapping for a given image size and circle. For example, a VB or C program that writes the displacements to a raw file, which you then open in Photoshop and save as a psd file. Photoshop could then be used to apply that map to a particular image.

If you interested in more general manipulations that are visually interesting, there are some very interesting things by playing with the polar<->rectangular coordinate transforms, including a transform that has a superficial resemblance to the inversion you describe.

Mike Russell
www.curvemeister.com/forum/
GH
Gernot Hoffmann
Mar 21, 2007
Mike Russell schrieb:

"G. A. Edgar" wrote in message

I want to start with an image. And a circle. Do some transformations. End up with a new image, which is the inversion of the original image in the circle.

Gernot is correct that Photoshop itself cannot deliver what you are asking for.

If you can get some programming to bear on the subject, the simplest way to accomplish this would be to create a displacement map that defines the inversion as a 2d mapping for a given image size and circle. For example, a VB or C program that writes the displacements to a raw file, which you then open in Photoshop and save as a psd file. Photoshop could then be used to apply that map to a particular image.

If you interested in more general manipulations that are visually interesting, there are some very interesting things by playing with the polar<->rectangular coordinate transforms, including a transform that has a superficial resemblance to the inversion you describe.

Mike Russell
www.curvemeister.com/forum/

Mike,

the question appears here in the PhS forum because of
cross-posting.
This kind of algorithmical image processing can be done
by MatLab, for instance.

Best regards –Gernot Hoffmann

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

Related Discussion Topics

Nice and short text about related topics in discussion sections