Saving an .xisf file in PI to .jpg or .tiff

Jerry GerberJonny Bravo
24 replies746 views
Jerry Gerber avatar
When I stretch an .xisf image in PI and it looks good, I save it either as a .jpg or .tiff and when I open it in my photo editor all the stretching is gone.

But if I save it as a .fit file and open it in ASI Studio and then save it as a .jpg or .tiff, it remains stretched. 

Is there a way to save a file in PI that remains stretched when I open it in a program such as Photoshop?

Thanks,
Jerry
Well Written Engaging
Rob Foster avatar
Jerry just to clarify, are you talking about saving a permanently stretched non-linear image or saving an autostretched (STF) linear image? When I save a non-linear image as a 16 bit TIFF image, I am able to import into Lightroom or Photoshop and all edits are there.
Helpful Concise
Die Launische Diva avatar
https://www.youtube.com/watch?v=amSRsZ8sCoI&t=444s

This is from the official PixInsight channel. They have already posted many introductory videos. Keep an eye on this channel as they are planning to post many more videos.
Well Written
Jonny Bravo avatar
What exactly is your process for stretching the data in PI?
Rob Foster avatar
It depends on the image, but I will permanently stretch sometimes using Screen Transfer Function and Histogram Transformation, or sometimes the MaskedStretch process, or sometimes the Generalized Hyperbolic Stretch script.  Many times I will remove stars and then permanently stretch stars gently with STF/HT (so I can carefully titrate and avoid blowing out the cores) but use GHS to do the starless image before recombining using Pixelmath in the non-linear state.
Jerry Gerber avatar
Rob Foster:
Jerry just to clarify, are you talking about saving a permanently stretched non-linear image or saving an autostretched (STF) linear image? When I save a non-linear image as a 16 bit TIFF image, I am able to import into Lightroom or Photoshop and all edits are there.

Hi Rob,

I'm referring to an image that is permanently stretched and saved.  If I then save it as a 16-bit tiff or jpg, and open it in ACD Photo Studio Ultimate (very much like Photoshop with layers, tons of processing tools, but doesn't require a subscription) it has to be re-stretched.  Easy to do, but I wonder why it opens up as outstretched in the first place.
Jerry Gerber avatar
Die Launische Diva:
https://www.youtube.com/watch?v=amSRsZ8sCoI&t=444s

This is from the official PixInsight channel. They have already posted many introductory videos. Keep an eye on this channel as they are planning to post many more videos.

Thanks!  I actually did save the stretched image, not the STF one, which I realize only stretches the image visually.  But my photo editing program still opens the 16-bit tiff or jpg unstreched!
Jerry Gerber avatar
Jonny Bravo:
What exactly is your process for stretching the data in PI?

I use STF to look at the stretched image, and if it looks OK I close STF and do the stretching in the Histogram Transformation process. 

Am I doing something wrong?
Jonny Bravo avatar
Doesn't sound like you're doing anything wrong, but something is missing since when you open the saved JPG it isn't stretched. I just did an experiment and the output was exactly what I'd expect. Apply just STF and the saved image is linear. Apply histogram transform and the saved image is non-linear. I opened both images up in Luminar 4.

Are you on Windows or Mac? (Only asking because I'm on a Mac and know the keyboard shortcuts… not familiar with them in Windows) smile

Hover over the "Undo" button in PI after you've done the histogram transformation. Does it show "Undo: HistogramTransformation"?
Helpful Engaging Supportive
Jerry Gerber avatar
Jonny Bravo:
Doesn't sound like you're doing anything wrong, but something is missing since when you open the saved JPG it isn't stretched. I just did an experiment and the output was exactly what I'd expect. Apply just STF and the saved image is linear. Apply histogram transform and the saved image is non-linear. I opened both images up in Luminar 4.

Are you on Windows or Mac? (Only asking because I'm on a Mac and know the keyboard shortcuts... not familiar with them in Windows)

Hover over the "Undo" button in PI after you've done the histogram transformation. Does it show "Undo: HistogramTransformation"?

I am on windows 10.   I am definitely saving the file as stretched, not linear.  But saving it to jpg or tiff and opening it in my terrestrial photo software shows a linear version.  I can easily stretch it again, but I would think it would already be stretched as that was how it was saved, I am sure..
Jonny Bravo avatar
Do you have some examples of these files you're willing to share? The only way I can make any terrestrial editor (Luminar 4, GIMP, Apple Photo, Preview) behave the way you describe is to give it an image that's not stretched. Once I apply HT in PI and save the image in either JPG or TIF, it opens up as a non-linear image in them all.

If you save the JPG and it opens as linear in your photo editor, what happens if you open that same JPG in PI?
Well Written Helpful Insightful Respectful Engaging Supportive
Jerry Gerber avatar
Jonny Bravo:
Do you have some examples of these files you're willing to share? The only way I can make any terrestrial editor (Luminar 4, GIMP, Apple Photo, Preview) behave the way you describe is to give it an image that's not stretched. Once I apply HT in PI and save the image in either JPG or TIF, it opens up as a non-linear image in them all.

If you save the JPG and it opens as linear in your photo editor, what happens if you open that same JPG in PI?

I do, but it's a PI native file, so it's over 300 MB!   I don't think I can email it to you, it's too big. I'd be curious to see if you can open it as a stretched jpg or tiff.  If you can, then my photo program is probably not able to open stretched files..
Jonny Bravo avatar
Got a Google drive? You can upload there and send the link to it.

Also, take one of your "linear" JPGs and (i.e. one that when you open in your terrestrial program that seems to be linear). Open that same JPG in PI.
Jerry Gerber avatar
Jonny Bravo:
Got a Google drive? You can upload there and send the link to it.

Also, take one of your "linear" JPGs and (i.e. one that when you open in your terrestrial program that seems to be linear). Open that same JPG in PI.

Attached is a jpg made from a native PI file.  Even on my Windows desktop, not my photo editing software, the image is definitely not stretched.  And when I close and re-open the jpg in PI, it's also not stretched.  I must be doing something incorrectly...

What do you think?
andrea tasselli avatar
Are you actually changing the histogram itself before clicking on the dark dot button? Because if you don't it won't change anything. Disable STF so that the image would look like the one you posted above, open HistogramTransformation and actually move the mid-tones pointer to the left using the preview button (empty circle) until you're satisfied and then click the apply button (dark circle) and you should definitely see the jpg stretched, once saved.
Helpful
Andy Wray avatar
You defintely need to make sure that all screen transfer functions are reset before you save an image.  see this:



I usually save to PNG, so you could try that as an alternative.

If you have reset the screen transfer function, then what you see in PixInsight is what you should see in other programmes.
Jerry Gerber avatar
andrea tasselli:
Are you actually changing the histogram itself before clicking on the dark dot button? Because if you don't it won't change anything. Disable STF so that the image would look like the one you posted above, open HistogramTransformation and actually move the mid-tones pointer to the left using the preview button (empty circle) until you're satisfied and then click the apply button (dark circle) and you should definitely see the jpg stretched, once saved.

I'm pretty sure I am doing that, because when I save and reopoen the native PI file, it's stretched.  If I were not applying the stretch in the Histogram Transformation process, when I reopen the native PI file, it would be linear, right?

I'll try again and make certain I am pressing "apply".  Thanks Andrea!
andrea tasselli avatar
Jerry Gerber:
'm pretty sure I am doing that, because when I save and reopoen the native PI file, it's stretched.  If I were not applying the stretch in the Histogram Transformation process, when I reopen the native PI file, it would be linear, right?


No, it would be applying any previous STF so it would appear "stretched" but it isn't. The STF stretching info is embedded into the .xisf header by default.
Jerry Gerber avatar
andrea tasselli:
Jerry Gerber:
'm pretty sure I am doing that, because when I save and reopoen the native PI file, it's stretched.  If I were not applying the stretch in the Histogram Transformation process, when I reopen the native PI file, it would be linear, right?


No, it would be applying any previous STF so it would appear "stretched" but it isn't. The STF stretching info is embedded into the .xisf header by default.

Ah, that might be the problem!   Back to PI!!
Jonny Bravo avatar
Jerry Gerber:
Attached is a jpg made from a native PI file.  Even on my Windows desktop, not my photo editing software, the image is definitely not stretched.  And when I close and re-open the jpg in PI, it's also not stretched.  I must be doing something incorrectly...

What do you think?


That's not a stretched image. When you open the saved XISF file in PI, if you'd applied the STF previously, it opens with that same STF applied. It only _appears_ to be stretched. That's why I was asking whether you were on Windows or macOS. If it was macOS, I would have told you to click on your image and hit control-S. That enables/disables the STF. If your image went from stretched back to looking like the image you attached, that means you have _not_ stretched the image, but only applied the STF.
Well Written Helpful Insightful Concise
Jerry Gerber avatar
Jonny Bravo:
Jerry Gerber:
Attached is a jpg made from a native PI file.  Even on my Windows desktop, not my photo editing software, the image is definitely not stretched.  And when I close and re-open the jpg in PI, it's also not stretched.  I must be doing something incorrectly...

What do you think?


That's not a stretched image. When you open the saved XISF file in PI, if you'd applied the STF previously, it opens with that same STF applied. It only _appears_ to be stretched. That's why I was asking whether you were on Windows or macOS. If it was macOS, I would have told you to click on your image and hit control-S. That enables/disables the STF. If your image went from stretched back to looking like the image you attached, that means you have _not_ stretched the image, but only applied the STF.

Well, you are correct.  I must not have been actually processing the file, only the display of it.  As soon as I followed through with the Histogram Transformation and actually changed the file and saved it, my tiffs and jpegs are stretched as expected.   Thank you for the advice!

Funny thing is, it doesn't much matter whether I do the final stretching in PI or in my ACD photo editing software, as I have the same, or similar, control over most all visual components except things specific to astrophotography like star size.  But I will continue to dive into PI as I can tell it's very powerful software, I sense it's a very deep program with much to learn about.
Respectful Supportive
Jonny Bravo avatar
Jerry Gerber:
But I will continue to dive into PI as I can tell it's very powerful software, I sense it's a very deep program with much to learn about.


There is a saying about that... if there are 3 ways to do something, PI has 10.

Yes, it's a deep program with a whole slew of processes and scripts to work on astrophotography data. Some of my favorites are the WBPP script for creating masters, DBE for gradients, SPCC for color correction, all of Russell Crowman's Xterminators (StarXterminator, NoiseXterminator and the new BlurXterminator), DarkArchon's EZ scripts, Mike Cranfield's GHS, Hartmut Bornemann's GAME script, Bill Blanshan's various pixel math scripts.

There are some absolutely fantastic resources out there to help you learn. Adam Block's Fundamentals course. Keller's Mastering PixInsight. Tons of YouTube videos (including more and more on the official PixInsight channel). Contributors here on this forum and others like CN, PI, Stargazer's Lounge, etc.
Helpful Engaging
wsg avatar
Jerry, one more thing.  Don't save in PI as a jpeg, always save as a 16 bit Tiff, in fact stay as a tiff file for all processing including going back and forth to PI.
Convert from Tiff to as large a jpeg as possible only before posting on Astrobin.  It's also a good idea to save both the Tiff and the Jpeg in your own storage.

scott
Helpful
Jerry Gerber avatar
Jerry, one more thing.  Don't save in PI as a jpeg, always save as a 16 bit Tiff, in fact stay as a tiff file for all processing including going back and forth to PI.
Convert from Tiff to as large a jpeg as possible only before posting on Astrobin.  It' also a good idea to save both the Tiff and the Jpeg in your own storage.

scott

Yeah, thanks wsg.  I always edit in tiff and only save to jpg for web viewing..
Jerry Gerber avatar