This is a final act of celestial beauty before the long fade into cosmic history. Invisibly buried in the centre of this colourful swirl of gas is a dying star, roughly the same mass as the Sun.

As a star ages, the nuclear reactions that keep it shining begin to falter. This uncertain energy generation causes the stars to pulsate in an irregular way, casting off its outer layers into space.

As the star sheds these outer gases, the super-hot core is revealed. It gives off huge quantities of ultraviolet light, and this radiation causes the gas shells to glow, creating the fragile beauty of the nebula.

This example is known as Kohoutek 4-55. Named after its discoverer, the Czech astronomer Luboš Kohoutec, it is located 4600 light years from Earth, in the direction of the constellation Cygnus.

This image was the final ‘pretty picture’ taken by the Hubble Space Telescope’s Wide Field Planetary Camera 2 (WFPC2). The camera was installed in 1993 and worked until 2009, offering a 16-year stretch of unparalleled observations.

WFPC2 took many of Hubble’s iconic images. They helped to make the space telescope a household name across the world.

This particular shot is a composite of three images, each taken at a specific wavelength to isolate the light coming from particular atoms of gas. The different wavelengths have been colour-coded to aid recognition.

Red signifies nitrogen gas, green shows hydrogen and blue represents oxygen. The whole sequence was captured in 2 hours on 4 May 2009.

The intricate swirls of gas offer us a glimpse of our Sun’s distant future. In 5 billion years’ time, our star will be dying. It is expected to behave in the same way as see here, shedding its outer layers to reveal the burning core, which then becomes a slowly cooling ember known as a white dwarf.

By that time, Earth will be long gone, burnt to a crisp as the Sun dies. But the beauty of our star’s passing will shine across the Universe.

This image was first published on the Hubble Space Telescope website on 10 May 2009.