An astronomy-focused set of tools with a GUI that uses spectrum construction and eye absorption to compute realistic colors.
Input data is accepted in the form of filters measurements (such as color indices) or continuous spectra, in irradiance units or in magnitudes. Stores a comprehensive catalog of photometry in a proprietary format. Can process spectral cubes, multiband spacecraft images and correct images in enhanced colors.
To calibrate the color of maps based on TCT data, I recommend using Cylindrical Texture Calibrator.
TrueColorTools works on Windows and Linux (the GUI library might be unstable on macOS). Python version 3.12 or higher is required.
- Install uv;
- Clone the repository or download the archive using the GitHub web interface;
- Open the console in the project root folder;
- Install the dependencies with
uv sync; - Execute
uv run tct.
Startup options such as --lang de can be passed to the application.
An alternative way for Windows 8/10/11. Stable versions are compiled into an executable file, Python installation is not required.
- Go to the latest release page;
- Download and unpack the first archive;
- Launch the executable from the archive (
runTCT.exein current releases).
TCT converts photometric measurements into a continuous spectrum (if it isn't already a spectrum) and convolves it with eye color matching functions (CMFs). A set of photographs (e.g. taken by a spacecraft) is counted and processed in the same way as photometry.
The computational core is AstroColor: it owns spectra, filter profiles, synthetic photometry, spectral reconstruction, phase models and color transforms. TCT adds the JSON5 database, ObjectName parsing, external file import, the GUI and the color-table renderer.
According to a common color processing procedure, after convolution from CMF to CIE 1931 XYZ color space, the color is converted by a 3×3 matrix to the selected color system. The matrix is formed from the specified color space and (optional) white point for chromatic adaptation. The default is the most common color space (sRGB) with a natural-looking white point, equal-energy spectrum (illuminant E).
The photometric measurements read from the database are calibrated at runtime using the specified calibration system and filter profiles. Zero points are not required. Spectra and filter profiles are stored on a grid with a 5-nm step in energy spectral density units (e.g., W/(m² nm)).
Interpolation is not used to reconstruct the spectrum from the photometry because it is not a solution to the inverse problem (i.e., looking at the spectrum through the filters does not give exactly the original photometry). Therefore, the Tikhonov regularization method is applied, which (almost) guarantees the solution of the ill-posed problem. A combination of first-order and second-order differential operators is chosen for the Tikhonov matrix (tries to minimize height variations and curvature in the spectrum) with a restriction to negative values.
Interaction with TrueColorTools is implied through the GUI. Advanced Python users should use astrocolor as the spectral processing library; TCT's core.py is now a thin database/file adapter (DatabaseEntry, read_spectrum_file, get_filter) rather than a second spectral library.
If you are running the GUI from the command line, you can set the startup language with --lang (for example, uv run tct --lang de); run uv run tct --help to see the current list. Bundled and custom filter profiles work offline. Profiles not yet cached are downloaded from SVO FPS on first use; this requires an Internet connection.
Filter profiles are identified by SVO FPS IDs of the form Facility/Instrument.Band, for example Generic/Bessell.V. Use the fourth tab, Filter catalog, to select a facility, instrument and band, then copy the compound filter ID from the output field and paste it into the filter field of the tab you are working with. Filter IDs are checked on every keystroke against the locally indexed catalog without network access; an ID that cannot be completed from that catalog is cleared. Numeric values are still accepted as monochromatic wavelengths in nanometers.
Program interface is functionally divided into tabs: Database viewer, Image processing, Blackbody & Redshifts and Filter catalog. The sidebar contains the common color settings. The Format color output button under the color preview opens a separate window with the settings that affect exported tables and text: color depth and decimal places. The same window previews the current object's color formatted with those settings.
The Database viewer tab provides access to the spectra database and allows you to calculate a color with the selected settings by simply clicking on an object. Under the preview it shows the HTML color and the R/G/B channel values with their uncertainties, and a synthetic measurement in the selected filter. It is possible to plot one or more spectra from the database in a pop-up window. You can process the colors of an entire category at once and get the output in text form or as a graphical table (examples).
The Image processing tab accepts regular images, a series of black and white images, or a spectral cube as input. Using the wavelength information, the image is "re-shot" in true color. The internal operations are similar to reconstructing the spectrum for each pixel, but use efficient operations on arrays.
The Blackbody & Redshifts tab calculates the influence of physical phenomena on color. Based on the blackbody spectrum, the program displays the color and brightness changes due to Doppler and gravitational redshifts. The left side shows the surface radiance in physical units for the selected filter ID; the ID is applied as you type. Surface brightness is tied to the Maximize brightness checkbox, otherwise can be adjusted with the slider.
The Filter catalog tab lists the facilities, instruments and bands known to AstroColor. Choose an entry in each of the three columns; the full filter ID is composed below them. Copy this ID and paste it into a filter field of the Database viewer, Blackbody & Redshifts or Image processing tab. Local, cached and custom profiles are shown immediately; SVO FPS facilities are added in the background when the service is available.
- Tag system: Any spectrum in the database can be assigned any set of tags. They form lists of categories for the Database viewer tab, which makes working with the database easier.
- Reference system: Each object in the database can be easily linked to one or more data sources by its short name. You can see the list in
Menu→References. - Multilingual support: The language can be changed from the top menu at runtime. TCT supports English, German, Russian and Arabic. If you want to add support for your language, you can do it similar to
strings.pyand make a commit or contact me.
The JSON5-formatted database stores two types of data: references and (photo)spectral objects. There are no restrictions on their order and relative position (data block and its reference block can be in different files), it is usually more convenient to list the sources at the beginning of the file or right before the spectra they describe.
The object name may contain formatting indicators for the GUI and the color table, the template is (index) name: note (info) | reference. The contents of the brackets are placed in the upper left corner; colon followed by a note; what appears after a vertical bar is reference(s) and is placed in the upper right corner. The naming conventions in the GUI may vary and try to follow naming standards in astronomy.
The brightness scale is not strictly tied to physical quantities. The albedo-type keys (is_geometric_albedo, is_spherical_albedo, is_albedo) mark the spectrum as an albedo, so its brightness is treated as a reflectance factor. Alternatively, geometric_albedo, spherical_albedo or albedo scale the spectrum to a known albedo in a band.
Geometric albedo is a reflection coefficient at the zero phase angle (normal albedo is now not distinguished from geometric albedo). It is usually brighter than the spherical albedo, which is the fraction of incident light that is reflected. If one is not specified in the database or can't be calculated from the phase function, TCT uses a theoretical model to convert one to the other for the appropriate brightness display mode. If no albedo is specified, the object is not shown in albedo modes (except for objects tagged star). The albedo key indicates both albedos at once, but it is not recommended.
Phase functions determine the phase integral, which converts between spherical and geometric albedo. A phase function is stored as [name, {param1: value1, …}]; each parameter may include an uncertainty. The Hapke model also calculates albedo, so [filter/nm, name, params] is supported to set the reference spectral range (other models ignore it).
The following phase functions are supported:
phase coefficient: requiresbeta, the logarithmic slope parameter;exponentials: requiresA_1,mu_1, …,A_n,mu_n, see Velikodsky et al. 2011;HG: requiresGparameter (His optional), see Bowell et al. 1989;HG1G2: requiresG_1andG_2(His optional), see Muinonen et al. 2010;Hapke: requiresw,bo,h,b,candtheta, see Hapke, B. 1984.
For photometry, set calibration_system unless the calibration spectrum is flat in energy per wavelength (this link may help): use 'AB' for AB-calibrated photometry (for example, Sloan u, g, r, i, z) and 'Vega' for Vega-based systems. For absolute magnitudes, set is_reflecting_sunlight: false.
Supported input keys of a database unit. The entry name is the JSON5 key, not an input field; the types below are JSON5 types.
tags(list): category strings used by the GUI to group and filter the entry; optional.wavelength_nm(list): wavelengths in nanometers.spectral_dist(list): brightness values in energy spectral density per wavelength, one per wavelength or filter; items may be[value, std]pairs.magnitudes(list): magnitudes, one per wavelength or filter; items may be[value, std]pairs.uncertainty(number or list): common or per-point standard deviations forspectral_distormagnitudes.nm_range(dict): wavelength grid as{start: …, stop: …, step: …}in nanometers.spectral_slope(dict): spectral slope{start: …, stop: …, power/percent_per_100nm: …}that defines the grid and brightness; values may include uncertainties.file(str): path to a text or FITS spectrum file, preferably underspectraorspectra_extras.file_geometric,file_spherical(str): paths to separate geometric and spherical albedo spectra; when both are present, they share one wavelength axis.filters(list): filter names known to AstroColor/SVO FPS or wavelengths in nm for monochromatic filters; both forms may be mixed.filter_set(str): common prefix for filter names infilters, usually the photometric system or instrument.color_indices(dict): color indices as{'filter1-filter2': value, …}; values may be[value, std]pairs.calibration_system(str):'Vega'or'AB'zero-point calibration; when omitted, theSTenergy-density scale is assumed.geometric_albedo(list): geometric albedo constraint as[filter_or_nm, value], used to scale the geometric albedo spectrum.spherical_albedo(list): spherical albedo constraint as[filter_or_nm, value], used to scale the spherical albedo spectrum.albedo(list): common geometric and spherical albedo constraint as[filter_or_nm, value].bond_albedo(number or list): bolometric Bond albedo constraint asvalueor[value, std]; the spherical albedo is scaled to it by the Solar spectrum.phase_integral(number or list): phase integral asvalueor[value, std], converting geometric albedo to spherical albedo.phase_function(list): phase function as[name, {param: value, …}], used to compute the phase integral.sd_geometric,sd_spherical(list): separate geometric and spherical albedo spectra; items may be[value, std]pairs.std_geometric,std_spherical(number or list): uncertainties forsd_geometricandsd_spherical, common or per-point.is_geometric_albedo(bool): treat the input spectrum as geometric albedo.is_spherical_albedo(bool): treat the input spectrum as spherical albedo.is_albedo(bool): treat the input spectrum as both geometric and spherical albedo.is_reflecting_sunlight(bool): divide the data by the normalized Solar spectrum.is_emission_spectrum(bool): treat the input points as spectral lines.is_emissive(bool): treat the data as emissive, without albedo scaling; render it in chromaticity mode.is_photon_counter(bool): convert photon spectral density to energy spectral density.
Standard deviations may be given as [value, std] or [value, +std, -std] for an asymmetric deviation.
A spectrum may be stored outside JSON5 and referenced by the file key; albedo spectra are referenced by file_geometric and file_spherical. Text (*.txt, *.dat) and FITS (*.fits, *.fit) files are supported. A text file must contain at least wavelengths in the first column and irradiance in the second; the third column may contain standard deviations and the fourth may contain a mask (1 marks good rows in SMASS data). FITS data are read from the second HDU. If a FITS file fails to load, contact me with the example.
As in JSON5, the default wavelengths for external files are in nanometers and the spectrum is in energy density. For FITS files, TCT attempt to determine the wavelength unit from internal data. You can also force the data type by using letters in the file extension (.txt for example):
.txtNfor nanometers (by default),.txtAfor ångströms,.txtUfor micrometers;.txtEfor energy counters per wavelength (by default),.txtJfor energy counters per frequency (like jansky),.txtPfor photon counters.
The data in the /spectra folder can be modified by the user (except for Sun and Vega, which are used for calibration). The display order in the Database viewer is determined by the file names and the order within the file. If the spectrum header is repeated in the database, the last spectrum will replace the previous one. The tag list is created and completed while reading files. /spectra_extras is recommended as the storage location for user files and addons; they will be shown last in the GUI. There is a pinned issue for sharing "official" and user addons. Pull requests are welcome too.
TCT uses filter sensitivity profiles for accurate spectrum restoration. AstroColor searches for them in this order:
- profiles bundled with AstroColor (currently the Bessell UBVRI, Sloan SDSS g/r and CIE 1931 CMFs);
cached_filters/, populated automatically from the SVO Filter Profile Service;custom_filters/, for profiles that are not available in SVO FPS (these are maintained in this repository).
A profile is identified as Facility/Instrument.Band, for example Generic/Bessell.V. Use the Filter catalog tab to browse the available IDs and copy the compound one. The folder layout mirrors that identifier: custom_filters/Facility/Instrument.Band.datA. An extension can specify the wavelength unit (A for ångströms, U for micrometers) and detector type (P for photon counting, J for energy per frequency). Profiles downloaded from SVO FPS are cached locally, so they are read from disk on subsequent launches.
Short help on the UBVRI photometric system implementations:
Generic/Johnsontakes into account the sensitivity of photomultiplier tubes, mostly affected on R and I bands. Use only if the measurements were actually taken on a PMT.Generic/Cousinscontains only R and I bands. Can be used directly with the U, B, V from the Johnson system, but the error is expected to be large.Generic/Bessellis actually Johnson—Cousins system for CCD receivers. Recommended by default.
uv sync --dev adds the test and type-checking tools: the suite can be run with uv run pytest, types can be checked with uv run ruff check and uv run basedpyright.
My thanks to arbodox for the creation of the project logo. Thanks to SevenSpheres for the Windows releases compilation. Thanks to the Celestia community for the support.
Original translators: FarGetaNik (German), Omarius257 (Arabic).
This research has made use of:
- Spanish Virtual Observatory project funded by MCIN/AEI/10.13039/501100011033/ through grant PID2020-112949GB-I00
- Colour & Vision Research laboratory and database
- AstroColor, the spectral and color engine used by TCT.

