Author Topic: using previews in pixelmath expression  (Read 3535 times)

Offline astroedo

  • PixInsight Addict
  • ***
  • Posts: 171
  • Io ne ho viste... cose che voi umani...
    • L'arciere celeste
using previews in pixelmath expression
« on: 2014 June 05 01:39:28 »
Hello all,

Is it possible to use previews in PixelMath expression?

For example I would like to evaluate the background of the image so I can use the median level of a patch of sky.
I would like to create a preview on my image an use it with the med (image) function of pixinsight without cloning the preview in a new image.

Thanks

Edoardo

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: using previews in pixelmath expression
« Reply #1 on: 2014 June 09 00:41:21 »
Hi Edoardo,

PixelMath works with main views, not with previews. You can of course apply PixelMath to a preview, but you cannot use a preview in a PixelMath expression.

You can make an independent image from a preview (PREVIEW > Make Image, or just drag a preview's view selector anywhere on the workspace) and then use its name in PixelMath expressions.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline astroedo

  • PixInsight Addict
  • ***
  • Posts: 171
  • Io ne ho viste... cose che voi umani...
    • L'arciere celeste
Re: using previews in pixelmath expression
« Reply #2 on: 2014 June 09 04:03:04 »
Thank you Juan for reply.
The "drag and drop" technique is the one I'm using now and it works well.

My goal was to create reusable "script-like" PixelMath icons without the need for creating a new image from preview used for median or mean estimate.

......I will begin to study for learning java script  :D

Only for curiosity: it would be difficult to implement the "preview support" for pixel math?

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: using previews in pixelmath expression
« Reply #3 on: 2014 December 18 08:50:08 »
PixelMath works with main views, not with previews.

I would like to add a wish list for this. It would simplify PJSR scripting by avoiding the need to create and manage temporary images.

You can of course apply PixelMath to a preview.

Open an image, change its Id to "A". Create a preview in A. Apply the PixelMath expression "A" with "Create new image" to A's preview. PixelMath generates no image nor an error message (i.e. size mismatch?). Bug?

Mike
« Last Edit: 2014 December 18 08:56:43 by mschuster »

Offline astroedo

  • PixInsight Addict
  • ***
  • Posts: 171
  • Io ne ho viste... cose che voi umani...
    • L'arciere celeste
Re: using previews in pixelmath expression
« Reply #4 on: 2014 December 18 09:06:02 »

Open an image, change its Id to "A". Create a preview in A. Apply the PixelMath expression "A" with "Create new image" to A's preview. PixelMath generates no image nor an error message (i.e. size mismatch?). Bug?

Mike

In my experience create new image never works with previews.

This is not a BUG in my opinion because previews are intended to preview ( :D ;D ) the result of the expression before applying to the whole image.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: using previews in pixelmath expression
« Reply #5 on: 2014 December 18 09:13:51 »
Quote
Open an image, change its Id to "A". Create a preview in A. Apply the PixelMath expression "A" with "Create new image" to A's preview. PixelMath generates no image nor an error message (i.e. size mismatch?). Bug?

No bug. It works this way by design. As Edoardo says, the preview in this case reproduces the result that you would obtain as a new image if you applied the instance to the main view.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/