Jump to content

Resampling with PixInsight


Scooot

Recommended Posts

I’ve attempted to resample my last couple of images with PixInsight’s resample process but I must be making an error. I’m attempting to do it by changing the default resolution of 72 x 72 to 300 x 300. The process seems to work by reducing its size in inches&cm whilst maintaining the size in pixels but when I save the image and then reopen, it reverts to its original size & resolution.

I can reduce the size of the image by altering the percentage but that reduces the images resolution?

So I’m doing something daft can anyone help? Many thanks.

Link to comment
Share on other sites

We have to be careful here as there are so many terms named resolution :D

Not sure what are you trying to achieve, but let's first name things in the way that we can understand what is going on:

Let display resolution be number of pixels in width and height.

Let DPI be print resolution, or number of dots per inch in both width and height.

There is simple relationship between the two above:

image size in inches = display resolution / DPI

Resampling means changing display resolution of image, or number of sample points that image has (or pixels). You can down sample - meaning take current display resolution and out of it create smaller image in terms of number of pixels in width and height and you can up sample image - create display resolution with larger number of pixels.

In relation to printing this has "meaningful" consequence - keeping DPI the same you will get smaller or larger image (down / up sampling in that order).

There is another way to get smaller or larger image when printing that does not involve resampling - this is simple change of DPI.

DPI is device dependent quantity. Screen for example has 72dpi or more modern monitors with high density have 96dpi. Printers can have dpi values in range of 150 up to 1200 and more dpi. With printers you can usually select DPI value that you want your image to be printed at in certain increments - like 150, 300, 600, 1200 dpi.

So what are you trying to do?

1. Resample image to different screen display resolution?

2. Assign different DPI to image (print resolution)? - if the second option, then you need to save your image in file format that has DPI information embedded. Saving as fits for example is not going to preserve DPI information. Saving as TIFF on the other hand should (I'm not 100% sure about this, but it is standard format in DTP so if any format saves dpi - it would be this one).

DPI is related to print really and has no impact on display resolution of the image, so it could well be that you need to set it prior to printing and it might not be saved with image at all.

 

Link to comment
Share on other sites

Thanks for the long explanation Vlaiv.

I was trying to reduce the size of my image for posting on SGL without reducing the quality of the image, particularly when you zoom in on it. Images I’ve recently posted on SGL appear very large when I view them with a PC, although my iPad fits them to the screen.

So I used the method in the light vortex tutorial. He reduced the size by increasing the resolution as per below.

In order to reduce the size of my images for posting in the past I’d just lowered the percentage in the dimension box, but doing it this way seemed to worsen the image quality, particularly when zooming in.

40C9E434-54B1-489F-8257-58D8E3D27F5C.thumb.png.2002d5e8a8d2043e2c802dc7a5bea15e.png

 

Link to comment
Share on other sites

Percentage boxes is proper way to do it - to lower display resolution. Setting DPI will have no effect on image size on screen.

When down sampling an image you will definitively loose some of high frequency information in image, but that might not be noticeable if image is viewed at maximum 1:1 pixel (no browser zoom-in to more than 100%).

You need to select proper resampling filter for best results - just go with Lanczos 3, as I'm aware PI has this filter implemented.

Don't put too small resolution either - choose something that will fit on most of screens when viewing image directly - today most monitors support 1920x1080 or so, so take this to be your baseline, depending if image is oriented "portrait" or "landscape"

btw - resampling filter should be under "interpolation" section

 

Link to comment
Share on other sites

8 hours ago, Scooot said:

 

I was trying to reduce the size of my image for posting on SGL without reducing the quality of the image, particularly when you zoom in on it. Images I’ve recently posted on SGL appear very large when I view them with a PC, although my iPad fits them to the screen.

 

I think you're trying to have your cake and eat it! If you reduce the size of the image on the screen you reduce the number of screen pixels available to separate the finest details. Howevver, in astrophotos the finest 'details' are often just the noise, so resampling downwards is very effecting in making them disappear- so the perceived quality of the image improves.

You really do need a lot of excellent data in order to present an image at full size (one camera pixel getting one screen pixel.) You also need to think about the seeing because if this is blurring details which are theoretically available to your system the image won't ever look good at full size. Seen thus the 'empty resolution' (that blurred out by the seeing) will just make the image look lumpy, like a smoothed out version of a pixelated image.

 When imaging small targets I have no choice but to put in the time needed to present at full size because I'm going to be cropping the frame so that the object is a respectable size.

Olly

Link to comment
Share on other sites

Thank you Olly, I appreciate the time you’ve taken to comment.

My older resized images showed very blocky stars when zoomed in whereas at full size they were as I saw them on my monitor before posting. So I decided not to resize them from then on.
However, recently I noticed the posted full versions are a little awkward to view on a monitor because the viewer has to scroll unless they click to open them. So I decided to revisit resizing hence this thread.
Following Vlaiv’s post I’ve realised I misinterpreted the Lightvortex guidance (something I’m good at :)) as this is aimed at printed images for publication. 

Currently I’m almost exclusively imaging with my Canon 450 and Samyang 135mm on my Star Adventurer from home so my data is never really that good. It’s very light polluted with usually poor seeing, and tracking is unguided so I can’t expose for too long. Also I can never usually image for much more than an hour due to clouds etc. I haven’t yet tried to add data from subsequent days, mainly because I use the camera viewfinder to find and frame the target so it seems quite difficult to reframe the image as before.

Nevertheless I’m enjoying it, and gradually learning more about image processing. Anyway back to resizing, it seems I should just judge the pros and cons that you’ve both mentioned on an image by image basis.

Link to comment
Share on other sites

5 hours ago, Scooot said:

Thank you Olly, I appreciate the time you’ve taken to comment.

My older resized images showed very blocky stars when zoomed in whereas at full size they were as I saw them on my monitor before posting. So I decided not to resize them from then on.
However, recently I noticed the posted full versions are a little awkward to view on a monitor because the viewer has to scroll unless they click to open them. So I decided to revisit resizing hence this thread.
Following Vlaiv’s post I’ve realised I misinterpreted the Lightvortex guidance (something I’m good at :)) as this is aimed at printed images for publication. 

Currently I’m almost exclusively imaging with my Canon 450 and Samyang 135mm on my Star Adventurer from home so my data is never really that good. It’s very light polluted with usually poor seeing, and tracking is unguided so I can’t expose for too long. Also I can never usually image for much more than an hour due to clouds etc. I haven’t yet tried to add data from subsequent days, mainly because I use the camera viewfinder to find and frame the target so it seems quite difficult to reframe the image as before.

Nevertheless I’m enjoying it, and gradually learning more about image processing. Anyway back to resizing, it seems I should just judge the pros and cons that you’ve both mentioned on an image by image basis.

If this is the case, and you don't aim for your images to be presented at 1:1 and Canon 450 has enough mega pixels, do binning of your image instead of resize. Do this before you start stretching data and post processing, while still in linear phase.

This will increase your SNR and quality of data. Like Olly said, resampling also has similar effect - but mechanism is different - due to resampling filter used, some of high frequency components get cut off. White noise has uniform frequency distribution and any such filtering is cutting off high frequency components thus making noise lower. This is done after processing and stretch. In my view it's better to gain SNR prior to processing. So bin at least x2 (or use super pixel mode), then process and resample to wanted display resolution at the end after processing.

 

Link to comment
Share on other sites

46 minutes ago, vlaiv said:

If this is the case, and you don't aim for your images to be presented at 1:1 and Canon 450 has enough mega pixels, do binning of your image instead of resize. Do this before you start stretching data and post processing, while still in linear phase.

This will increase your SNR and quality of data. Like Olly said, resampling also has similar effect - but mechanism is different - due to resampling filter used, some of high frequency components get cut off. White noise has uniform frequency distribution and any such filtering is cutting off high frequency components thus making noise lower. This is done after processing and stretch. In my view it's better to gain SNR prior to processing. So bin at least x2 (or use super pixel mode), then process and resample to wanted display resolution at the end after processing.

 

Thanks again.

I don’t understand binning or how to do it. I just had a quick google, do I use the integer resample process? https://pixinsight.com/doc/tools/IntegerResample/IntegerResample.html

Edit,

or superpixel mode when I debayer? https://pixinsight.com/doc/tools/Debayer/Debayer.html

 

Link to comment
Share on other sites

1 hour ago, Scooot said:

Thanks again.

I don’t understand binning or how to do it. I just had a quick google, do I use the integer resample process? https://pixinsight.com/doc/tools/IntegerResample/IntegerResample.html

Edit,

or superpixel mode when I debayer? https://pixinsight.com/doc/tools/Debayer/Debayer.html

 

There are couple of ways to do it.

One is super pixel mode. Since you are using OSC camera, maybe that is the simplest approach. Canon 450 produces 4272 x 2848 pixel image. Super pixel mode will therefore produce 2136x1424 subs to be stacked. Once you do alignment and stacking final stack will probably be a bit less than this so around 2000x1400 or something - you will need to resample it a bit down when done.

Another way to do it is use regular debayering to produce full size subs. Stack those and in the end do for example 3x3 bin on resulting image. Quick search on google gave me this:

Geometry > IntegerResample with average method. So yes - the link you provided with average method is software binning. You can do this on each of your subs or you can do it on final stack (easier I guess).

If you go for 3x3 software bin you will end up with image that is about 1400x900 pixels - that is pretty good for posting online so you will not need to do additional resampling when done processing.

Link to comment
Share on other sites

33 minutes ago, vlaiv said:

There are couple of ways to do it.

One is super pixel mode. Since you are using OSC camera, maybe that is the simplest approach. Canon 450 produces 4272 x 2848 pixel image. Super pixel mode will therefore produce 2136x1424 subs to be stacked. Once you do alignment and stacking final stack will probably be a bit less than this so around 2000x1400 or something - you will need to resample it a bit down when done.

Another way to do it is use regular debayering to produce full size subs. Stack those and in the end do for example 3x3 bin on resulting image. Quick search on google gave me this:

Geometry > IntegerResample with average method. So yes - the link you provided with average method is software binning. You can do this on each of your subs or you can do it on final stack (easier I guess).

If you go for 3x3 software bin you will end up with image that is about 1400x900 pixels - that is pretty good for posting online so you will not need to do additional resampling when done processing.

Thank you,

Since I last posted I did a little experiment with one of my comet subs. This is the result

C25ECA5A-6B4B-4255-9178-EE32673F4369.thumb.jpeg.f54e2062887fa191d3ee4ec5e4a3d55f.jpeg

 

So it seems to me that the integerResample would be the best method for my setup. It’s quite a difference to the SNR. Both methods halved the width and height by pixel.

Link to comment
Share on other sites

Yes, only drawback to binning / IntegerResample is that it adds slight additional blur and increases FWHM slightly (this is very small effect to be noticed even when looking at 1:1 pixel - image will look sharper then before binning). This is due to what is called "pixel blur". All resampling methods add a bit of this, but with binning it is the largest.

You can see it in your data - original FWHM was 14.6, or with halved resolution that would be 7.3. Super pixel mode is measured at slightly higher 7.75 while binning x2 is at 8.16

Link to comment
Share on other sites

13 hours ago, Scooot said:

A slight bluring might help. My small stars tend to have sharp coloured rings round them (probably due to lack of critical focus) and I tend to soften the effect with a little convolution.

I suspect a different cause but can't be sure. It might be the anti-aliasing algorithm you're using. When I used OSC I did my pre-processing in AstroArt which had an adjustable anti-aliasing routine, though I always found the default worked perfectly for me.

Olly

Edit: if you're interested in experimenting with this AA can be tried for free with a 'no save' restriction.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.