Author Topic: Problem with Substitue with Preview  (Read 533 times)

Offline tdgm

  • PixInsight Old Hand
  • ****
  • Posts: 302
Problem with Substitue with Preview
« on: 2019 November 23 18:42:27 »
Hi

I am having trouble getting Substitute with preview to work. I am running 1.8.8.1 on a Mac. I create a preview on an image than save that preview to the desktop perform whatever to the image and than open the script. When I go to choose the iamge to source and target there are no images with a preview to choose. It is not in any source or target drop down list. So when I use a image without a preview it gives me an error message no image with a preview but It does not show me any image with a preview.


Please help maybe a bug or maybe more likely operator error.

Please help or give me some direction to find an answer.

Steve

Offline ngc1535

  • PixInsight Old Hand
  • ****
  • Posts: 326
Re: Problem with Substitue with Preview
« Reply #1 on: 2019 November 23 19:25:00 »
If you would like, you can try the straightforward pixel math expression below:

x=x();
y=y();
x0=1095;
y0=1560;
width=870;
height=695;
iif(inrect(x0,y0,width,height),pixel(Prev_name,x-x0,y-y0),$T)

Where x0,y0,width and height correspond with the top left corner and dimensions of the preview (get the values from Edit Preview).
The numbers here are meaningless/placeholders.
To use this expression..just replace "Prev"name" with the name of your preview.
I made this expression for myself before I knew about the Substitute with Preview script.

Just something to try while you wait for your answer.
-adam

Offline tdgm

  • PixInsight Old Hand
  • ****
  • Posts: 302
Re: Problem with Substitue with Preview
« Reply #2 on: 2019 November 23 19:31:38 »
Hi Adam


Thanks for the response. I actually used your pixel math example(download from your web page, I brought both the fundamental and Horizon series). It woked just trying to understand how Script works.


Steve

Offline ngc1535

  • PixInsight Old Hand
  • ****
  • Posts: 326
Re: Problem with Substitue with Preview
« Reply #3 on: 2019 November 23 19:46:31 »
AH!
GREAT!!
Substitute with Preview does generate a new window/image as I recall... whereas the pixel math expression writes directly to the intended image. The only issue is you have to grab the preview's vital numbers- whereas this is automatic in the script's implementation. I think I demonstrated it briefly in my materials... but no idea why it would not work for you.
-adam

Offline tdgm

  • PixInsight Old Hand
  • ****
  • Posts: 302
Re: Problem with Substitue with Preview
« Reply #4 on: 2019 November 23 19:56:04 »
Hi Adam

Where in your material is it so I can review it and maybe I am just not doing it correctly.

Steve

Offline tdgm

  • PixInsight Old Hand
  • ****
  • Posts: 302
Re: Problem with Substitue with Preview
« Reply #5 on: 2019 November 23 21:00:05 »
Hi Adam

I found the material in your lessons and I reviewed it. The workflow is a little different in Substitute with preview you make a clone of original image than a preview in the clone work on Preview with HDRMT and when finished just substitute that clone image with the preview into the original image and yuou come up with the final view.

In youe insertion method you make a preview in original image make a separate preview image  work on that preview (as a whole image) and when done use the numbers from the preview in the original and insert it back into the original.

Now That I know how I was not doing the substitute with preview correctly so I will be able to do it next time Thanks for the advice.

Steve

Offline ngc1535

  • PixInsight Old Hand
  • ****
  • Posts: 326
Re: Problem with Substitue with Preview
« Reply #6 on: 2019 November 23 21:11:01 »
LOL. *I* couldn't find it... (where was it?)
I am glad things are making sense.
-adam

Offline tdgm

  • PixInsight Old Hand
  • ****
  • Posts: 302
Re: Problem with Substitue with Preview
« Reply #7 on: 2019 November 23 21:16:38 »
Hi Adam

Pixinsight Fundamental Techniques 1st on Image/Preview insertion Talk about first half of video.

Steve