Skip to content

Interactive Starfield Generator with Constellations

Generate a customisable night sky on canvas. Set star density, brightness, and colour temperature, overlay the Big Dipper or Orion, draw your own constellation, and download as PNG or JPEG.

Interactive Starfield Generator

Generate a night sky on a canvas. Adjust how many stars appear, how bright they are, and what colour they take, then overlay a constellation or draw your own by clicking stars. Download the result as a PNG or JPEG.

Click a star to start your own constellation. Each further click joins the next star with a line.
px
px
Loading calculator...
๐Ÿ“š

Documentation

This tool draws a night sky in the browser. Sliders control how many stars appear, how bright they are, and what colour they take. A constellation can be laid over the field, or a new one drawn by clicking stars, and the finished picture downloads as a PNG or JPEG.

How the starfield is built

Each sky comes from a seed, a single number that drives a pseudorandom generator. The same seed always produces exactly the same stars, so a sky can be reproduced or shared. The generate button moves to a new seed rather than picking at random, which is why the picture never changes on its own.

The number of stars follows the canvas area and the density setting:

stars = width ร— height ร— density รท 10000

So density is the number of stars per 10,000 square pixels. An 800 by 500 canvas at density 12 holds 480 stars.

Brightness distribution

Real skies contain a few bright stars and a great many faint ones. The generator copies that by drawing each star's brightness from a power law rather than spreading brightness evenly.

The brightness slider changes the exponent. At the low end the exponent is 4, so most stars come out faint and only a handful stand out. At the high end it falls to 1, giving an evenly lit, showier field. Size and transparency both follow brightness, so faint stars are small and see-through, which reads as distance.

Star colour

A star's colour follows its surface temperature. The generator converts a temperature in kelvin to a colour using the usual blackbody approximation.

TemperatureAppearanceExample
3000 KorangeBetelgeuse
5800 Kyellow-whitethe Sun
9900 KwhiteSirius
12000 Kblue-whiteRigel

The colour schemes pick from different parts of that range. Mixed samples the whole range, which looks closest to a real sky.

Constellations

Two shapes are built in. The Big Dipper is an asterism of seven stars in Ursa Major. Orion is a constellation whose three belt stars, Alnitak, Alnilam and Mintaka, lie in an almost straight line. Both are stored as relative positions, so they scale to any canvas size.

A custom constellation is drawn by clicking. Each click snaps to the nearest star and joins it to the previous one with a line, so the shape follows the stars actually in the field.

Downloading

The download buttons save the canvas at its full pixel size, so a 1600 by 1000 canvas gives a 1600 by 1000 image. PNG keeps every pixel exactly and suits flat starfields well. JPEG produces a smaller file but can leave faint blocky marks around small bright points.

Everything happens in the browser. No image is uploaded.

Frequently asked questions

Is this a map of the real sky?

No. The stars are generated, not catalogued. Only the two constellation overlays reflect real star patterns. For real positions, use an astronomical calculator that takes a date and a location.

Why does the same sky come back after reloading?

The sky is determined by the seed, and the seed is kept in the page address. Sharing the link shares the exact sky. Press generate for a new one.

Why did my drawn constellation disappear?

It is tied to the stars in the current field. Changing the seed, size, density, brightness or colour rebuilds the stars, so the drawing is cleared.

Which format should I download?

PNG for quality and for further editing. JPEG when file size matters more than exactness.

Can I make a very large image?

Canvas width and height go up to 2000 pixels each. Very large canvases at high density hold many thousands of stars and take longer to draw.