Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Image Processing In Mathematica - Getting the Colour Pallet you want


Recommended Posts

One of the challenges in image processing is getting the required colour in you image without spending half a day playing around with curves, saturation levels etc. There are a number of tools available in most image processing packages that allow you to match colours from one image to another. However what is really wanted is to be able to match your image to another colour pallet (e.g. Hubble or ESO etc) so you can mimic some of the more iconic images from the data you have collected.

One tool I have found that performs an excellent and every quick job of mapping one image to another is Mathematica (http://www.wolfram.com/mathematica/)  a very powerful general purpose mathematics package that also does image processing in a programmatic way for those that enjoy doing a bit of coding.

The process is pretty straight forward and only requires 6 lines of code. I have included a snap shot of the work I recently performed on M42 taken under hostile Wimbledon skys using an unguided C6SE on an alt-az mount.

The steps to obtain a processed image are given here:

1) Load RAW image (in this case from DSS without adjustment / cropping etc)

2) Load Pallet image 

post-22791-0-14459000-1399841964_thumb.p

NOTE: The pallet image should have quite similar characteristics to your image in terms of FoV if possible this will help get the desired background as well as foreground.

3) Investigate the image histograms of your image and the pallet image. Check that the pallet image has the required bit depth, else there could be problems. Mathematica allows smoothing functions to remove the issues around the discrete values seen from low bit depth images or images taken at high ISO (this will be shown in subsequent posts)

post-22791-0-11969300-1399841977_thumb.p

4)Finally perform the image transformation - in Mathematica this is know as the HistogramTransform

post-22791-0-38970900-1399841998_thumb.p

Then the image can be exported for final processing in your favourite point and click photo editor.

Here is the final image 

Orion 20140110 CropBlurCurve PS v0.03

This was taken from my back garden in Wimbledon on 10 Jan 2014, Celestron 6SE x0.63 reducer - alt-az unguided , Canon 1100d unmodded 34 x 24s, ISO 800 (25 darks, 5 bias frames taken using the laptop held up to the telescope !). So even with modest equipement and light polluted skies some powerful image processing can give you some great images.

I will follow up with some more pallets and techniques to improve the final images in later posts.

Link to comment
Share on other sites

Thanks, Mathematica really offers almost a one stop edit of your images. This has saved me hours and allows the process of creating an image to be reproducable, rather than the artistic hand that is normally required to get the light dark and colour balance.

Link to comment
Share on other sites

When we talk about a 'palette' we are normally describing how we map a wavelength (or range thereof) to a colour channel in tricolour imaging packages. What you are are doing here, it seems (though I may have got this round my neck!) is using one image to determine the colour balance of another. I see a clear distinction between colour balance and palette. I recently admired Jonas Grinde's high resolution M31 in part for its attractive colour balance, but I won't be using his image to calibrate the colour balance of mine. I would consider that unethical. I might measure his colour balance in order to understand it (though I haven't) but I wouldn't under any circumstances copy it.

Olly

Link to comment
Share on other sites

When we talk about a 'palette' we are normally describing how we map a wavelength (or range thereof) to a colour channel in tricolour imaging packages. What you are are doing here, it seems (though I may have got this round my neck!) is using one image to determine the colour balance of another. I see a clear distinction between colour balance and palette. I recently admired Jonas Grinde's high resolution M31 in part for its attractive colour balance, but I won't be using his image to calibrate the colour balance of mine. I would consider that unethical. I might measure his colour balance in order to understand it (though I haven't) but I wouldn't under any circumstances copy it.

Olly

In the astronomical context your are correct in the use of mapping a wavelength of light to a colour range. This technique does a colour -> colour transformation and maps one set of histograms to another as such you can regard it as an advanced colour balance mapping.  The mapping is of histogram PDF -> histogram PDF a functional mapping.

I understand your view on the ethics of such a transformation, however the response of each individuals equipment and  lighting conditions may generate particular coloured regions that are not widely prevalent in the matching image. One might argue that obtaining a decent colour balance is a technical skill in much the same what as the use of autoguiding is.

It would be great to reproduce an image from its sprectrographic information, correct it for instrument responses and backgrounds  and define the wavelength -> colour map as the best scientific images are, however for the amateur or professional imager this posses a real challenge as to what is the "real" colour response.

Most astro images are "works of art" in a sense that colour is somewhat subjective, though that is not to detract from the skill and effort required to obtain the images in the first place.

This technique is provided for those who wish to be able to match the colours available from publicly available images, without the fiddling required to tweek curves somewhat arbitrarily or artistically depending on ones view point. 

Link to comment
Share on other sites

You mathematica folks may want to look at this: http://blog.wolfram.com/2010/12/27/fixing-bad-astrophotography-using-mathematica-8-and-advanced-image-deconvolution/

It's also possible in PixInsight intro and how

If you want to get scientific about colour - use a calibrated scanning spectrograph. LRGB images really are three colour images as the mono CCD cannot distinguish the range of wavelengths within the broadband filter.

For an example of using a spectrograph to create a 2D image - have a look at Christian Bull's page here: http://www.astrosurf.com/buil/scan/demo.htm

Link to comment
Share on other sites

Archived

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

×
×
  • 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.