Changelog#
0.9.1 (2026-10-29)#
pc.save_pngrefuses to write its PNG into a folder (or among the files of a pattern) it reads, or over one of its images:pc.save_png(".", "view.png"), meant to save a viewer, saved the folder’s earlier PNGs as a mosaic instead, and would have taken in each new one. Its message points at the viewer’s own method,v.save_png(path).The module behind
pc.Vieweris private (pixel_clarity._viewer):pc.viewerread like “the viewer on screen” and had asave_pngof the data. Import names frompixel_clarityitself.
0.9.0 (2026-10-29)#
The viewer is Pixel Clarity 1.10.0. New with it: figures for papers and talks (the export dialog’s Figure tab: axes, colorbar, compass and scale bar, regions and contours as vector marks, saved as PDF with its fonts or as a PNG at a chosen dpi), Load all (right-click: the whole image brought into the view, down to full resolution, so a huge image pans without waiting), one progress line with the time left for a shared page or an export, and a clear message when a web page comes back in place of SIMBAD’s or VizieR’s data. The full-resolution PNG is the dialog’s second tab, or right-click › Export full-resolution image….
pc.save_png(data, path)writes the PNG a viewer’s Export › Full-resolution image would, with no viewer on screen: for many files in a loop, or a script. The data is opened as a viewer opens it (settings,pc.defaults, a mosaic’s level matching and colors) and rendered next to the data.viewer.save_png(path)(also a pop-up window’s) saves a view as it was left in a viewer: its stretch, colors, levels, turn and crop (area="crop");state=gives other data that look.binaverages blocks of pixels. Regions, text and a colorbar are drawn only by the dialog.
0.8.0 (2026-10-24)#
The viewer is Pixel Clarity 1.8.2. New with it: frame subtraction (below), the frame slider for a file with one frame per extension, and sky coordinates for ASDF files whose WCS is a single FITS imaging transform (resampled mosaics), so a folder of them opens as a mosaic on the sky.
Frame subtraction:
pc.show(..., subtract=)(andpc.stack,pc.popup) shows each frame of a cube or stack less a reference:"first","previous","ramp"(the first read of each ramp), a frame number, a(first, last)pair for their mean, or another image such as a bias or a dark;divide=Truedivides instead. The viewer’s Δ button by the frame slider changes it. The difference is made in the viewer’s process, so its statistics, plots, exports and shared pages are exact, and Save values as FITS… writes it next to the notebook. Stacks of files subtract across files, and a file opened to compare with can be the reference.share()keeps it, also for a view no viewer has shown yet (except less another file, which needs a viewer’s view first).
0.7.0 (2026-10-19)#
The viewer is Pixel Clarity 1.7.4. New with it: undo and redo, contours, display smoothing, a coordinate grid and scale bar, a star quick look (Shift+R), and ellipse, annulus, polygon and turned box regions (also in
.regfiles both ways). A turned box’s profile runs along its own sides.More formats: JPEG images, NetCDF-4 (
.nc,.nc4) and MATLAB v7.3 (.mat) files open as images; VOTables (.vot,.votable), Arrow/Feather files and FITS tables open in the table viewer.pc.showsends a FITS file of tables and no image to the table viewer. A folder’s listing leaves.matfiles out (name them to show them).pc.table(path, table=...)opens one of a file’s tables: a FITS table by EXTNAME or HDU number, a VOTable’s by its place. A FITS file with an image and a catalog lists the catalog with its images, and choosing it opens it in the table viewer, in a tab.Catalogs over the view (Gaia, 2MASS, SIMBAD, VizieR): their rows open in the table viewer, saved as an ECSV file next to the notebook. Gaia and 2MASS load in seconds: the viewer’s process asks VizieR’s TAP service for them (from the server, which a browser can’t), and the browser asks VizieR’s usual interface as well if that is slow; the first answer is used.
Contours of another file: Of → Other file… in the contour popover picks an image on the server with a file picker in the page, and lines its contours up with the view through the sky.
Linked views: Link ties viewers of one kernel together (in the notebook and in tabs), matched on the sky or by pixel; Open beside, linked… opens images in new tabs, already linked.
regionsandregions_ds9give ellipses, annuli, polygons and turned boxes.Through the kernel (no direct connection), what would open in a tab says how to open it from Python instead.
0.6.0 (2026-10-17)#
The viewer is Pixel Clarity 1.6.1: a line or a box plots the values along it in a pane under the image (a spectrum along its trace, a cross section). A line widens into a band, each point then the mean, median or sum across it, with the sky beside the band subtracted if you like; RGB views plot a curve per channel, color mosaics one per filter. Copy or save as TSV/CSV.
add_regions(..., profile=True)opens the profile of the first line,projectionor box added.regions_ds9writes a widened line as DS9’sprojection(regionsgives it as a line, since theregionspackage doesn’t read projections).Docs: a page on profiles and spectra.
The viewer is Pixel Clarity 1.5.3: a region in a color view (several filters, or RGB) is measured in the filter being edited, and its magnitude says which (mag and the filter on its card, mag (AB, …) in the Regions panel, a measured in column in Copy statistics). Before, a color mosaic’s region was measured in whichever filter’s image was drawn on top under it.
0.5.0 (2026-10-16)#
pc.save_defaults(cmap=..., scale=..., ...)keeps settings for every new viewer in later sessions too (in~/.config/pixel-clarity/defaults.json, orPIXEL_CLARITY_DEFAULTS);pc.reset_defaults()forgets them.pc.settings()shows yours beside the defaults.viewer.share("page.html")writes the view as a web page of its own from Python, as the viewer’s Share as a web page does (compact data in the page or beside it, the files, links, or the preview only), so a script or a docs build can make them; no browser needed.examples/pixel_clarity_examples.ipynb: every viewer option in a call of its own, on sample data the notebook makes.Any number of viewers in one notebook. A browser keeps only so many WebGL contexts per page (16 in Chrome), and past that the oldest viewers’ images went blank for good; each viewer now holds one only while it is on screen and draws again from the tiles it kept when it comes back. Needs Pixel Clarity 1.5.1.
The viewer is Pixel Clarity 1.5.1: smooth pixels when zoomed in (
v, orsmooth_pixels=True), a HiPS shown the way its maker meant (its own cut and stretch, color tiles as they are;file_display=Falsefor the usual scale and limits), smoother HiPS up close, and a darker, cleaner sky from Auto enhance (auto_sky_brightnessnow 0.06 by default).
0.4.0 (2026-10-15)#
The viewer is Pixel Clarity 1.4.3: an opacity for each color (the % button beside the channel picker, for an RGB image’s channels or a color mosaic’s filters), color mosaics of any number of filters (each in its own hue), Square up in the turn menu, and cuts of very large images that read only the part in view. A turned HiPS keeps its turn on a shared page and when opened again.
HiPS:
pc.show()of a HiPS’s folder (the one holdingproperties), or of its URL, shows it however large, reading only the tiles in view. Right-click › Build HiPS… writes the image, RGB set or mosaic shown as a HiPS next to the notebook (the values, and for color views also the colors as shown), to open in Aladin or here.Large images open faster the second time in a session: their overviews, statistics and zoomed-out tiles are kept in the viewer process’s scratch folder (removed when the kernel stops; at most
PIXEL_CLARITY_CACHE_MB, 2000 by default, 0 to turn it off).Share as a web page works for images read from URLs (S3 included): the page carries their preview or their compact data. With Link to the data, it links a URL only when anyone may read it for good (https, not signed, not this machine).
The Share and Export dialogs, and a shared page’s Save popover, no longer close on a click outside them, and no dialog or popover closes when a text selection or a slider drag that began inside it ends outside.
0.3.0 (2026-10-15)#
The viewer is Pixel Clarity 1.3.0: turn the view to any angle (or north up), crop for a poster or wallpaper (full-resolution exports follow the turn and the crop), and blink between images.
pc.blink()(orblink=Trueonshow,mosaicandpopup) shows images one at a time, lined up on the sky (or pixel for pixel), to blink between them. Any mosaic can blink from its Detectors panel; a saved.pcmosaickeeps it, andpc.show()of that file opens it blinking.
0.2.0 (2026-10-15)#
pc.popup(): images and tables in a browser tab of their own, from any Python program (a script, IPython). Called again, it shows the new data in the same tab; an array of the same size is read again in place, keeping the zoom, pan and colors, so a loop can watch it change. A script waits at its end until its tabs are closed (or Ctrl-C);pc.wait()waits sooner.Images read from URLs are downloaded once: a summary of each image shown (a reduced copy and its statistics) lets it show again (in another viewer, a mosaic, or after its viewer slept) reading only the rows under the view. Summaries stay in the kernel’s viewer process, readable by its user only, and are used only after the URL has been read successfully again.
Arrays memory-mapped from
.npyfiles and untouched HDUs of open FITS files are read from their files, not copied; other arrays are hashed several times faster (in parallel).Every keyword of
show,table,rgb,mosaic,stackandpopupis spelled out and typed, settings included (pc.Settings), with a docstring for each: editors suggest the keywords and their allowed values, and flag a misspelled one.
0.1.0 (2026-10-15)#
First version:
pc.show()shows images, mosaics, RGB sets and stacks in a notebook with the Pixel Clarity viewer (from Pixel Clarity 1.2.0). Reads local files,s3://objects and URLs where they are, and arrays, HDUs, NDData, ASDF files and data models from the kernel.Connects directly to its process through jupyter-server-proxy (or to localhost), so the view keeps working while a cell runs; through the kernel elsewhere. Open in a new tab for a full window.
Full-resolution export, shared pages and saved mosaics are written next to the notebook; the Aladin Lite panel opens beside the viewer; the notebook’s light or dark theme is followed.
Regions both ways:
viewer.add_regions()drawsregionsobjects, a DS9 file or DS9 text on the view;viewer.regions(andviewer.regions_ds9) reads back what is drawn, also from a tab.Tables:
pc.table()(andpc.show()of a table file) opens CSV, TSV, ECSV and Parquet files, and astropy, pandas and polars tables from the kernel, in the Pixel Clarity table viewer. Sorting, filtering, statistics and plots are worked out on the server; exports are written next to the notebook; Overlay on image draws the rows on the image viewer used last.Sized for small servers: worker threads and caches follow the container’s CPU and memory limits, and viewers left idle free their memory. A file read from a URL keeps its downloaded blocks within its view’s share of memory, so a mosaic of many URLs stays bounded.