Insert part of one image into a second image - Pixinsight

Discuss how you are able to get those fantastic images!!!
Post Reply
User avatar
STEVE333 United States of America
Inter-Galactic Ambassador
Articles: 0
Offline
Posts: 3466
Joined: Sat May 11, 2019 5:01 pm
4
Location: Santa Cruz, Ca, USA
Status:
Offline

TSS Awards Badges

TSS Photo of the Day

Insert part of one image into a second image - Pixinsight

#1

Post by STEVE333 »


Sometimes you can have two versions of the same target (Image1 and Image2) and you like one region of Image1 but the remainder of the image looks better in Image2 (or visa versa). This technique allows you to "insert" a region of either image into the other image.

I will assume Image1 has the "region" that is to be inserted into Image2.

1) The two images must be stretched and also registered to one another.
2) With Image1 selected open the GAME script.
3) Using the GAME script create a Binary mask that surrounds the "region" of interest and name it "m". Make sure the mask is a bit larger than the region of interest to leave a "blending buffer".
4) Use Convolution to blur the edges of "m". This blurred region is where the two images will blend together yielding the desired smooth transition.
5) Open PixelMath and enter data as shown below (Image1 and Image2 represent the names of your two images):
Image
6) Click the square button to create the desired image (which will be named Blend)with the region of interest from Image1 inserted into Image2.
7) If the backgrounds don't match:
7a) Apply "m" to Blend.
7b) Use HistrogramTransformation and/or Curves to match the backgrounds.

I've successfully used this technique many times without any problems. Hope it is helpful for you.

I'll be glad to answer any questions if I can.

Steve
Steve King: Light Pollution (Bortle 5)
Telescope + Mount + Guiding: W.O. Star71-ii + iOptron CEM40 EC + Orion Magnificent Mini AutoGuider
Camera: ASI 1600MM Pro + EFW Filter Wheel + Chroma 3nm Siii, Ha, Oiii + ZWO LRGB Filters
Software: PHD2; APT; PixInsight ***** My AP website: www.steveking.pictures
Image
Image
User avatar
ram United States of America
Saturn Ambassador
Articles: 0
Offline
Posts: 350
Joined: Tue Jun 11, 2019 3:21 am
4
Location: Youngstown, NY, USA
Status:
Offline

TSS Photo of the Day

Re: Insert part of one image into a second image - Pixinsight

#2

Post by ram »


Hi Steve, I'm wondering if this approach would work on a pair of linear images or do they have to be nonlinear for it work? I tried it on a pair of linear images but the blended region just looks dark (or bright depending on which way I go).

(I was hoping to blended out the hard edges I get from image integrating different framings, I know I can do in the nonlinear version beautifully but since these are big files and I don't want to process two sets of images I was hoping there was a way to do this early on while the image was still linear.)

Thanks a lot!

--Ram
Tubes: Celestron 9.25" 235mm f/10 XLT EdgeHD SCT; Meade ETX 80mm f/5 achromat; Coronado SolarMax II 60mm f/6.6 Hα <0.7Å BF10 solar; Stellarvue 70mm f/6 triplet apochromat; Obsession UC18 457mm f/4.2 with Argo Navis & ServoCAT; Takahashi FS128 5" f/8.1 and FC100DF 4" f/7.4 fluorite doublet apochromats. Mounts: AVX; LXD75; Paramount MyT. Eyepieces: 2" Tele Vue Ethos 4.7/13/21mm, Paracorr, 2,4x Powermate; Stellarvue 0.8x, Takahashi 0.7x, 0.66x reducer/corrector. Cameras: ZWO ASI120MC-S; Lodestar X2c; X2m; Canon T7i; QHY163M; QHY247C; QHY294M-Pro. Filters: 1.25" Astrodon 5nm Ha, 3nm O3 and S2; Chroma LRGB.
Image
User avatar
STEVE333 United States of America
Inter-Galactic Ambassador
Articles: 0
Offline
Posts: 3466
Joined: Sat May 11, 2019 5:01 pm
4
Location: Santa Cruz, Ca, USA
Status:
Offline

TSS Awards Badges

TSS Photo of the Day

Re: Insert part of one image into a second image - Pixinsight

#3

Post by STEVE333 »


ram wrote: Sun Oct 11, 2020 7:25 am Hi Steve, I'm wondering if this approach would work on a pair of linear images or do they have to be nonlinear for it work? I tried it on a pair of linear images but the blended region just looks dark (or bright depending on which way I go).

(I was hoping to blended out the hard edges I get from image integrating different framings, I know I can do in the nonlinear version beautifully but since these are big files and I don't want to process two sets of images I was hoping there was a way to do this early on while the image was still linear.)

Thanks a lot!

--Ram

Hi Ram - I've only used it with nonlinear images. The problem with doing it at the linear stage is that if there are any problems with the blending they will be exaggerated when the image is stretched. When you blend the images in the nonlinear state you can see immediately if you need to redo or tweak the blending.

One hint. After blending the two images you can apply the mask to the blended image and then adjust the brightness/colors of the inserted portion (or if the mask is inverted to the main image) to improve the blending. This can be a very powerful technique to make the blending work.

Hope this helps,

Steve
Steve King: Light Pollution (Bortle 5)
Telescope + Mount + Guiding: W.O. Star71-ii + iOptron CEM40 EC + Orion Magnificent Mini AutoGuider
Camera: ASI 1600MM Pro + EFW Filter Wheel + Chroma 3nm Siii, Ha, Oiii + ZWO LRGB Filters
Software: PHD2; APT; PixInsight ***** My AP website: www.steveking.pictures
Image
Image
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Image processing”