For some abstract renderings, there are many things worth studying about the polar filter in Photoshop...
[Abstract] For some abstract renderings, there are many things worth studying about the polar coordinate filter in Photoshop...
I saw on foreign websites that someone divides Photoshop filters into two categories, one is filters that are not destructive to the original image, and the other is filters that are destructive to the original image. Destructive filters are mostly distortion filters, among which polar coordinates are quite destructive.
Because of the destructiveness of polar coordinates, many people think that this filter has little practical application for image and photo processing. However, if it is used for some abstract images, I think there are still some aspects of this filter worth studying. I hope you will You will also be inspired after reading this article.
1. Perceptual understanding of polar coordinate deformation
Let’s first look at what kind of distortion polar coordinates do to the image. As shown in the picture
This set of pictures are images of squares, circles and color blocks before and after polar coordinate transformation.
The change from rectangular coordinates to polar coordinates: it can be thought of as a process in which the top edge is concave and the bottom edge and both sides are turned up.
The change from polar coordinates to rectangular coordinates: It can be considered as the process of the bottom edge being concave upward, and the top edge and both sides turning downward.
The "process" mentioned here is only used to deepen memory. In fact, this process of turning up and down does not exist, but is directly mapped through coordinates.
1. Cartesian coordinates—>polar coordinates
The vertical lines in the original image become radial lines after polar coordinate transformation.
The horizontal lines in the original image become concentric circles after polar coordinate transformation.
Of course, if you draw it horizontally and vertically, it will become a spider web.
Please observe the position of each color block after transformation. The top of the original image shrinks to the center of the circle, and the red at the bottom becomes the inscribed circle of the canvas. The two blue color blocks on the left and right are flipped upward and finally merge into a fan shape, and the original two sides will overlap at the top.
Remembering the position of each color patch before and after it changes not only deepens your understanding of polar coordinate filters, but is also helpful in practical applications. At least now you have learned to draw radial lines, concentric circles, and fan shapes.
2. Polar coordinates -> Cartesian coordinates
The vertical and horizontal lines (except the coordinate axes) in the original picture are transformed into parabolas/hyperbolas in the picture (I haven't figured out the specific line shape yet, but I prefer it to be a hyperbola).
After transformation, the coordinate axes become five vertical dividing lines, of which 1, 3, and 5 are the original vertical axes, and 2, 4 are the original horizontal axes.
Regarding the change of color blocks, please pay attention to the position and amplitude. I haven't studied this much.
Btw: In the preface, I said that polar coordinates are destructive to images. In fact, polar coordinate filters also have a certain degree of reduction. After all, this is a mapping between coordinate systems. Some information of the original image can still be restored by performing inverse transformation on a graph that has been transformed forward. However, because polar coordinates do not have a one-to-one correspondence, the information at the edge of the graph cannot be recovered. More alternative applications can also use the reducibility of polar coordinates to encrypt images.
2. Application of polar coordinate filter
I use polar coordinate filters mainly to draw circles, or to draw images based on circles. We often see some repetitive and regular graphics drawn with vector software. In fact, some graphics can be completed using polar coordinate filters, sometimes better and with more changes than using vector software.
2.1 Production of radiation, see Part 1.
2.2 For the production of concentric circles, see Part One.
2.3 Fan type, ring type, rainbow, see part one.
2.4 Spiral
Drawing spirals in vector software is quite simple, and some software has its own spiral tool. But for PS, there is no particularly suitable tool or formula for drawing spirals. There is a Twirl filter in the distortion filter that can create a spiral-like effect, but it doesn’t feel very controllable.
I was inspired by drawing concentric circles and found that I can use the polar coordinate filter to draw spirals, whether they are equidistant or open, and the steps are relatively simple, only a few steps.
First create a rectangular blank file (400*20), draw a diagonal line (if it is a thick diagonal line, then pay attention to the diagonal line and draw diagonal lines on the other two top corners of the canvas to ensure that it can be filled in the next step. Normal connection), define the pattern. As shown in the picture
Create a new file (400*400) and fill it with the pattern just defined. As shown in the picture
Apply Polar Coordinates filter, Cartesian Coordinates - Polar Coordinates
Apply lighting filter.
Then apply the Spherization filter and other modifications, and you're done.
The picture above is for drawing equidistant spirals. If you draw unequal spirals, you need to change the spacing and slope of each oblique line.
Note: There will be a black trace on the lower right side of the picture. This black line is mapped from the black dots on the bottom edge of the original picture. After polar coordinates, the bottom edge of the original image will be mapped into a circle inscribed with the outer border of the new image (a square canvas, or an ellipse if it is a rectangular canvas) and all the blank spaces outside the circle. If you want to avoid this black line, just note that the bottom line of the original image is the background color. In fact, this line also has its own special usage, see the examples below for details.
The drawn spiral can also be made into a Gif animation using ImageReady.
2.5 Polar coordinate changes of longitudinal diagonal lines and grids
The principles are all the same. If you understand one, you will understand the others. But please note that if you are filling vertical lines, the new canvas size should be an integer multiple of the original defined pattern size. Otherwise, the left and right sides of the original image will not blend well after the polar coordinate filter.
The two pictures below use the black lines just introduced to create radial lines outside the inscribed circle.
The evolution of complex graphics
2.6 Polar coordinate changes of the grid
Using a simple grid combined with some other filters can create a variety of unexpected effects. As shown in Figure Group 6 ~ Group 9. Let’s take group 8 as an example to briefly introduce the production method.
Let’s draw the grid first. I wonder what method you use to draw the grid? Filling or other methods, we can discuss it later. I draw the grid using Tiles.
Use the polar coordinate filter (polar coordinates -> rectangular coordinates) to flip vertically.
Use the polar coordinate filter again (polar coordinates -> rectangular coordinates) and flip it vertically.
Then use the polar coordinate filter (Rectangular coordinates—>polar coordinates)
Use lighting filters, curves
The finished effect is as follows.
The preparation method of Group 7 and Group 9 is similar to that of Group 8, but with some additional steps mixed in.
Other applications
2.7 Making a CD
There are many ways to make a CD. This one is of course drawn using polar coordinates, but I don’t think it’s done well.
2.8 Radiographic text
Group 11, there are many tutorials on this online, so I won’t go into details.
In this case, what is the use of converting polar coordinates to rectangular coordinates ? In most cases, only a part of the image needs to be transformed to polar coordinates. If you directly "make a straight line -> convert rectangular coordinates to polar coordinates", the original image will also be distorted. Therefore, you can follow the method of "polar coordinates to rectangular coordinates -> make a straight line -> rectangular coordinates to polar coordinates" to keep the original image unchanged.
From this we can summarize the following characteristics of polar coordinate filters:
- The conversion from rectangular coordinates to polar coordinates is used to create effects, while the conversion from polar coordinates to rectangular coordinates is used to offset the side effects of the former;
- Horizontal lines are converted into circles, vertical lines into radial lines, and diagonal lines into spirals;
- The upper side of the original image corresponds to the center of the circle, and the lower side corresponds to the outside of the center of the circle;
combine with wind
The wind filter happens to be a great tool for making straight lines, especially straight lines with a fading radial effect. According to the above theory of "converting polar coordinates to rectangular coordinates -> making a straight line -> converting rectangular coordinates to polar coordinates", using wind to make a straight line can achieve the desired radiation effect
2.9 Polar coordinate changes of shape
This is my favorite and I came up with it by accident. Group 12.
The specific application will stop here. Finally, I will talk about a little bit of theory and talk about the working process of the polar coordinate conversion filter.
3. The working process of the polar coordinate filter (cartesian coordinates to polar coordinates) Generally speaking, any point (pixel) in a bitmap image can be represented by rectangular coordinates (x, y). Likewise this pixel can also be represented by polar coordinates (r,a). The working process of the polar coordinate filter is to process the pixel (x, y) based on the rectangular coordinate system through polar coordinate mapping (r, a) and then represent it by the rectangular coordinate (x', y').
The mutual conversion formula between rectangular coordinates and polar coordinates is as follows:
r = sqrt ( x * x + y * y )
a = arctg ( y / x )
x = r * cos (a)
y = r * sin ( a )
Below is a piece of pseudo code that simulates the work of a polar filter. I did not write this code, I just understand it. For a more detailed explanation, please refer to the link below:
http://www.jasonwaltman.com/thesis/filter-polar.html
(This is a foreign website. The website owner used C++ to simulate the effects of some PS filters and provided source code and source programs.)
for every pixel in the original image do
{
// x and y are the coordinates of the current pixel in Cartesian coordinates.
//The coordinates of the center point of the image are x = 0, y = 0.
// r and a are the polar coordinates of the pixel. The angle a is in radians.
r = sqrt ( x * x + y * y );
a = atan2 ( y / x );
// R takes half of the minimum length and width of the image.
R= min[image_width, image_height]/2
//The new x and y are the new coordinates of the pixel in the Cartesian coordinate system after the polar coordinate filter transformation. The purpose of this conversion, especially the selection of R and 6.2832 (2pi), I think is to limit the converted image to the original canvas size. At the same time, this step ultimately leads to the deformation of the image.
x = r * image_height / R;
y = a * image_width / 6.2832;
filterpixel.x = x;
filterpixel.y = y;
}
This is just a piece of pseudo code. The real execution process is more complicated. If you continue to go deeper, you will seriously miss the topic. So for in-depth discussion, please refer to that link and see it for yourself.
Finally, I conclude with a quote from that website.
"If used creatively, the effect is worth more than just its novelty."
I hope you can be inspired after reading this article. The words are not as good as the heart, and the heart is not as good as actions. I look forward to your works.