이 글은 오역을 감추기 위한 의역으로 점철되어 있습니다.
이 글은 저자의 허락을 받지 않았습니다.
=============================================================
포토샵 7.0을 이용한 그래디언트(Gradient) 제거
글쓴이 : 로브 폴라드(Rob Pollard)
머리말
천체 사진을 찍으면서 주로 겪는 어려움 중 하나가 바로 그래디언트(역주: Gradient, 광해 등에 의해서 이미지의 배경 한 쪽이 밝아져, 밝은 쪽에서 어두운 쪽으로 색이 서서히 단계적으로 변화하는 현상, 사진에서 사용하는 gradation(그라데이션, 계조)과 나타나는 모양이 비슷합니다.)입니다.
그래디언트는 주로 광해에 의해서 나타나지만, 그 이외에도 비네팅이나 먼지와 같은 여러 가지 원인에 의해서 발생합니다.
이 글에서는 포토샵 7.0을 사용하여 그래디언트를 제거하는 아주 기본적인 방법 한 가지를 소개합니다.
이 기법은 상당히 효과적이며, 특히 대상의 크기에 비해 배경이 차지하는 비율이 큰 이미지에 대해 사용하면 더욱 좋습니다.
이 기법은, 그래디언트에 대한 모든 정보가 이미지의 배경에 존재한다는 개념을 이용합니다.
그래서, 이미지의 사본을 만든 후, 이미지 내의 모든 대상을 지워 배경의 그래디언트만 남을 때까지, 이 사본을 바꾸어 나가는 방법을 사용합니다.
이 배경을 만드는 데 성공했으면, 이제 원래의 이미지에서 이 배경 이미지를 빼주기만 하면 모든 작업이 끝납니다.
자세한 방법을 위해서는 아래의 예제를 참고하십시오.
1단계. 그래디언트를 제거하려는 이미지를 열고, 이미지의 사본을 만들어 작업할 준비를 합니다.
여기에서는 NGC891의 컬러 이미지를 예제로 사용할 것입니다.
아래의 이미지에서 볼 수 있듯이, 이미지 왼쪽 가장자리에서 중간쯤까지 그래디언트가 존재합니다.

가장 먼저 할 일은, 이미지를 복사하여 작업할 이미지를 준비하는 것입니다.
이 이미지를 이용하여, 그래디언트만을 가지고 있는 배경이미지을 만들게 될 것입니다.
포토샵에서 복사하는 방법은 아래 그림과 같습니다. (Image | Duplicate...)

Duplicate를 클릭하면 복사된 Layer의 이름을 적을 수 있는 다이얼로그가 나옵니다.
여기에서는 Flat(역주: 아무것도 없는 평평한 면이라는 뜻. 그래디언트를 제외하고는 모든 이미지가 제거된 이미지라는 뜻에서 붙인 것 같습니다.)이라는 이름을 붙이겠습니다.
2단계. Dust & Scratches 필터를 적용합니다.
"Flat" Layer를 선택한 후, Dust & Scratches 필터(역주: 서로 다른 픽셀들을 비슷하게 변화시켜 노이즈를 제거합니다. Radius : 노이즈를 제거하는 정도를 설정, Threshold : 색상값의 차이을 이용하여 적용되는 범위를 설정.)를 실행시킵니다. (Filter | Noise | Dust & Scratches...)

Dust & Scratches 메뉴는 이미지가 채널당 16비트의 깊이를 가지는 경우 활성화되지 않습니다. (역첨: photoshop 7.01 trial로 시험했을 때, Dust & Scratches는 16비트 모드에서 활성화가 되었습니다.)
따라서 이 메뉴가 활성화되어있지 않은 경우는, 먼저 이미지를 8비트 이미지로 바꾸어 주십시오. (Image | Mode | 8 Bits/Channel)
( 역주:
color depth, 색의 심도. 픽셀 하나가 나타낼 수 있는 색의 수. 보통 bit 단위로 표시합니다. 1bit는 2가지의 색을 표시할 수 있습니다. 24bit의 depth는 RGB가 각 채널당 8bit의 depth를 가진 경우로, 표시할 수 있는 색의 수는 16,777,216 가지이고, 트루컬러라 부릅니다.
16 Bits/Channel에서 사용 가능한 명령들, The marquee, lasso, crop, measure, zoom, hand, pen, eyedropper, history brush, slice, color sampler, clone stamp tools, healing brush tool, patch tool, the pen and shape tools (for drawing work paths only). The Duplicate, Feather, Modify, Levels, Auto Levels, Auto Contrast, Auto Color, Curves, Histogram, Hue/Saturation, Brightness/Contrast, Color Balance, Equalize, Invert, Channel Mixer, Gradient Map, Image Size, Canvas Size, Transform Selection, and Rotate Canvas commands. Gaussian Blur, Add Noise, Dust & Scratches, Median, Unsharp Mask, Solarize, High Pass filters. 이 명령들 이외에는 사용 불가능합니다. )
Dust & Scratches를 클릭하면, 아래와 같은 다이얼로그가 나타납니다.

이 다이얼로그 박스는, 마지막으로 셋팅하였던 상태를 그대로 저장합니다.
그리고 일반적으로 여기에서 필요로 하는 값보다 상당히 낮은 값을 가지고 있을 것입니다.
우선 Threshold를 10으로 하고, 미리보기 윈도우의 이미지를 관찰하면서 Radius를 변화시켜봅니다.
Radius는 별과 주 대상을 지울 수 있는 최소한의 값으로 설정합니다.
Radius가 너무 크면 그래디언트에 대한 정보까지 사라져 완전히 검은 이미지가 만들어질 수도 있으니, 주의하십시오.
그러나 이 예제에서는 Radius의 값으로 100(포토샵에서 줄 수 있는 최대값)을 주는 것이 가장 적절합니다.
이 과정에서 제거되지 않은 별이 있다 하더라도, 나중에 다시 제거할 기회가 있으니 걱정할 필요가 없습니다.
Dust & Scratches 필터를 적용하면, Flat 이미지는 다음과 같이 됩니다.

우리는 단지 몇 번의 마우스 클릭만으로 그래디언트 정보를 남기고, 모든 별들을 지우는 데 성공하였습니다.
그러나 아직 끝난 것은 아닙니다.
은하의 형태는 사라졌지만, 그 주변부가 아직도 너무 밝기 때문입니다.
이 이미지를 이대로 처음의 이미지에서 빼게 되면, 장시간 노출을 주어 어렵게 얻은 은하의 이미지가 이로 인하여 어두워지게 될 것입니다.
3단계. 필요한 부분을 어둡게 합니다.
원하는 부분을 어둡게 하는 데에는 많은 방법이 있습니다.
가장 쉽게 생각할 수 있는 것이, 이 부분을 검은 색으로 칠하는 것이지만, 대부분의 경우 이는 부자연스러운 배경을 만듭니다.
가장 좋은 방법은 이미지 내의 가장 어두운 부분만큼 어둡게 칠하는 것인데, 이를 위해 Clone Stamp Tool을 사용합니다.
(역주: 버튼에 도장 모양이 그려져 있습니다. 일정 영역을 복사할 때 사용합니다. copy를 할 부분에 마우스를 대고 alt 키를 누른 채 클릭합니다. paste를 할 곳에 마우스를 클릭한 상태로 문지르면 alt키와 함께 클릭했던 부분을 중심으로 복사가 됩니다.)
Clone Stamp Tool을 선택했으면, Brush의 크기를 결정하고 Opacity(불투명도)를 50%로 줄입니다. (상단, 메뉴 아래에 있음)
이는 고친 부분이 눈에 띄지 않도록 조금씩 점진적으로 바꾸어 나가야 하기 때문에 필요한 설정입니다.
아래 그림은 제가 주로 사용하는 설정입니다.

이제 alt 키를 누른 상태에서 이미지 위의 가장 어두운 부분을 클릭합니다.
그러면 이 부분이 복사의 중심이 됩니다.
이제 은하가 있던 부분으로 가서, 이 부분을 어둡게 하기 위해 마우스로 살살 문지릅니다.
이 때, 대상보다 약간 더 바깥쪽까지 어둡게 하는 것이 좋습니다.
후에 가우시안 블러(Gaussian Blur)를 적용할 것이기 때문에 너무 깔끔하게 하려고 노력할 필요는 없습니다.
아래는 여기까지 작업이 끝난 이미지를 보여줍니다.

이제 은하가 있던 부분은 훨씬 더 어두워졌고, 그럼에도 매우 자연스럽게 보입니다.
또한 약간만 주의를 기울였다면, 그렇게 깔끔하게 하지 않아도 최종 이미지에는 거의 영향을 주지 않을 것입니다.
이 때까지 남아있던 별들도 Clone Stamp Tool을 사용하여 제거할 수 있습니다.
그러나 별을 제거할 때에는, 그 부분의 그래디언트 정보를 손상시키지 않기 위하여, 복사할 중심을 별 근처에서 선택하십시오.
4단계. 가우시안 블러(Gaussian Blur)를 적용합니다.
이 단계의 목적은 그래디언트 정보를 보존하면서 이를 부드럽게 하는 것입니다.
이것은 가우시안 블러를 적용하는 것으로 간단히 해결됩니다. (Filter | Blur | Gaussian Blur...)

Gaussian Blur를 클릭하면 아래와 같은 다이얼로그 박스가 뜹니다.

Radius는 슬라이더의 왼쪽 작은 값에서부터 시작해서, 그래디언트가 부드럽게 보일 때까지 아주 조금씩 증가시켜 나갑니다.
여기까지 했으면 이제 Flat를 완성한 것입니다.
이 Flat를 원래의 이미지에서 빼기만 하면 모든 작업이 끝납니다.
이 예제에서 만들어진 최종적인 Flat는 아래와 같습니다.

위에서 볼 수 있듯이, 가우시안 블러를 적용하기 전보다 훨씬 더 부드럽게 보입니다.
5단계. 원래의 이미지에서 Flat을 뺍니다.
이제 최종단계입니다.
우선 포토샵에 원래의 이미지와 지금까지 작업한 Flat이 모두 떠 있는 것을 확인합니다. (역첨: 두 이미지는 각각 다른 파일 이름으로 저장된 상태로 열려있어야 합니다.)
그리고 원래의 이미지를 선택한 상태에서 Image | Apply Image...을 클릭합니다.

Apply Image를 클릭하면, 다음과 같은 다이얼로그 박스가 나타날 것입니다.

Source는 Flat 이미지를 선택하고, Blending을 Subtract로 바꿉니다.
오른쪽의 Preview가 체크되어있다면, 처리의 효과를 바로 볼 수 있을 것입니다.
Opacity(불투명도)는 기본적으로 100%로 설정되어있을 것입니다.
그러나 이를 그대로 적용하면, 배경이 너무 어두워질 수 있습니다.
그러므로 Preview를 통해 이미지를 보면서, 적절한 정도까지 이 값을 낮추어줍니다.
이 예제에서, 저는 Opacity를 50%로 설정하였습니다만, 이보다 더 높은 주는 경우도 많이 있습니다.
일반적으로, 처음 이미지의 배경이 고르지 않을 수록, 요구되는 Opacity의 값은 더 커집니다.
모든 처리가 끝난 최종 이미지는 다음과 같습니다.

이 이미지를 처음의 이미지와 비교해보면, 배경의 그래디언트가 많이 줄어들었으면서도 디테일에는 전혀 손상이 없다는 것을 알 수 있을 것입니다.
Opacity를 더 증가시키면, 배경이 더 어둡고 색이 고른 배경을 얻을 수 있겠지만, 제가 보기에는 이정도만으로도 충분해 보입니다.
결론
이 기법이 꽤나 효과가 좋기는 하지만, 플랫필드(역주: flatfield frame, CCD의 각 픽셀마다 감도가 조금씩 다른 것, 비네팅, 칩에 묻은 먼지 등에 의한 효과 등을 보정하기 위하여 사용하는 프레임으로, 균일한 빛에 임의의 시간동안 노출을 주어 찍습니다. 그러나 플랫필드 프레임으로 광해에 의한 그래디언트를 제거하지는 못합니다.)를 대체하지는 못합니다.
게다가 대상이 이미지의 대부분을 차지하고 있는 경우에는 효과가 거의 없습니다.
그러나 이 기법은 상대적으로 빠르게 사용할 수 있을 뿐만 아니라, 이미지의 디테일을 희생하지 않고도 이미지를 조금이나마 개선시킬 수 있는 방법으로써 천체사진가들에게 이미지 처리의 폭을 넓혀줄 것입니다.
이 글이 여러분에게 도움이 되었기를 바랍니다.
시간이 날 때마다, 내용을 조금씩 추가해 나갈 예정입니다.
==역첨==
그래디언트 제거에 관련해서 볼만한 다른 홈페이지들..
Picture Window Pro를 이용한 그래디언트 제거
그래디언트를 제거하는 4가지 방법..
CCDSoft, MaxIm DL용 그래디언트 제거 플러그인
=============================================================
이하 원문
Gradient Removal for Photoshop 7.0
by Rob Pollard
Introduction
One of the major problems facing astro imagers is the presence of gradients in their images. These gradients can come from a variety of sources, including, but not limited to Light Pollution, Vignetting or Dust Motes. This article describes how to use Photoshop 7.0, utilizing some fairly basic techniques to get rid of your gradient problems. The technique is pretty effective, but works better with images that have a high proportion of empty space in relation to the objects size.
This technique utilizes the concept that the actual background levels in the image hold all the information that we need to remove them. The way we do this, is by creating a duplicate of the image and then successively altering it until it becomes a flat. IE an image that represents just the background gradients. Once we have this flat we simply subtract it from the original, and hey presto! One flat field! Below is a walkthrough example.
Step 1 Open the image in question and duplicate it
For this example, we are going to work on a colour image of NGC891. As can be seen from the image below, there is a light gradient coming in from the left hand edge of the image at galaxy level. This gradient is present up to about the middle of the image.

Our first step is to duplicate the image so that we have a starting image that will be our final artificial flat. In Photoshop 7 the Duplicate command can be accessed from the Image menu as shown below:

Click on this to create our duplicate image. Now is a good time to save the duplicate under some meaningful name. Ours is just called "Flat" for this example.
Step 2 Run the Dust and Scratches Tool
Ensuring that the Duplicate/Flat image is selected, run up the Dust and Scratches tool. In Photoshop 7 this can be found under the filter menu as shown below:

Click on the "Dust & Scratches" menu item. If this menu item is disabled, you will probably have a 16 bit image, in this case convert it to 8 bit before proceeding.
Clicking the "Dust & Scratches" command will activate the "Dust & Scratches" dialog window as seen below:

This dialog window "remembers" its last settings and will generally have the radius value set to a lot lower level than shown here. For our purposes, set the threshold to "10". Next observe your image in the preview window. The idea now, is to introduce the minimum amount of "Radius" that will remove all the stars from the image, as well as most of the main object. When altering the radius setting, try not to set it so high that you lose the gradient information in the image and actually end up with a completely black window.
For this example the best setting actually ended up being the maximum setting on the Radius bar. Don"t be too concerned if this doesn"t remove the very brightest stars, as we will cover them over later on.
After running the Dust & Scratches command with the above settings our Flat image now looks like this:

Note, that in this example, we have successfully got rid of all the stars and retained the gradient information, all with a few clicks of the mouse. However, we cannot use this flat "as is" because our object, the side on galaxy is still too bright, despite being a shadow of it"s former self. The reason for this, is that this flat will eventually be subtracted from our original image. Thus if we were to use this image, our galaxy would have a lot of hard won light deducted from it.
Step 3 Darken the object of interest
There are many ways to do this, but the best technique, is to set your object dark level to about the same as the darkest area on the flat. Painting over this area in black does sometimes work, but more often than not it leaves the image sticking out unnaturally from its background. Hence the reason for our cloning tool approach....
All we do is grab the cloning tool, setting its radius to a decent size and also setting it"s opacity to 50%. This bit is important, in that, we want our changes to work gradually on the image, so that it isn"t conspicuous. The settings that I tend to use are shown below:

Next select a dark area on the image by press the ALT key whilst clicking the left mouse button. This sets the source of the clone tools output. Carefully go over the galaxy portion and "Dab" it with this clone brush to darken it. Whilst carrying this out, make sure you go a little outside the boundary defined by the object. Don"t worry too much on neatness as this flat will have a Gaussian Blur carried out on it.
Here is how my Flat looks after "darkening" the galaxy:

Note the galaxy is now a "lot" darker than before and what is more, its darkness is within the natural range of the image. Also, note that I didn"t really worry too much about neatness here, as provided you are fairly careful, it shouldn"t matter much in the final image.
At this stage bright stars that have remained can also be removed by cloning. But in this case select the clones source nearby to the star to ensure the gradient in the area isn"t messed up.
Step 4 Apply Gaussian Blur to Flat
In this step, the object is to smoothen out the gradient but not get rid of it. This can be achieved with a simple Gaussian Blur. The Gaussian Blur command can be found under the filters menu, under the Blur Node:

When the Gaussian Blur is activated it will produce the following dialog window:

Once again, like most Photoshop commands, it remembers the last settings used. For the Gaussian Blur all we have to setup is the Radius. The idea here is to start off small with the slider on the left hand side, then slowly increase the radius until the gradient looks smooth. Once this is done, you have created your Flat! This Flat can now be used on the original image. In the example above my final Flat looked like:

As you can see, it is a lot smoother than the original.
Step 5 Subtract Flat from the original image
This is the final step! Before proceeding make sure both the Flat and the original image are loaded into Photoshop. Next ensure that the original is selected, then run the "Apply Image" command. This can be found under the Image menu:

On clicking the "Apply Image" command, the "Apply Image" dialog window will appear looking similar to the following:

In this window you firstly need to select the Flat as the source, then alter the Blending mode to Subtract. If the Preview tick box is checked you will immediately be able to see the effect of your changes on the original image.
By default the "Apply Image" dialog window applies images with a 100% opacity. This will probably be too much for your image and result in a background that is too dark. So the next step requires you to continually lower this value whilst monitoring the original image, until you get the background at a desired level that you want.
For this example I ended up setting it to 50%, although its not unusual for it to be a lot higher. Generally speaking, the more uneven the original background, the more Opacity you will require.
After running this final step, my finished image looks like:

Comparing this image with the original at the top of the page, it can be seen that the background is much flatter, without any loss of detail. If I wanted a flatter darker background I could of just as easily increased the Opacity setting, but this looks right on my monitor, so I"m sticking with 50% for this image.
Conclusion
Whilst this technique works rather well, it should not be used as a substitute for taking good flats, nor can it be used very well with large objects. However, it is relatively quick to employ and gives the astro imager that bit of extra freedom to get that last bit of detail out of their images without compromising the background.
Hope you found this article useful. If I get time I will progressively add more to the series.