H5TOPNG(1)
π H5TOPNG(1) β the h5utils era π
okay bestie, sit DOWN, because this one is a whole vibe. welcome to h5topng, part of the h5utils collection, and no cap it is genuinely iconic.
β¨ NAME β¨
h5topng β generate PNG images from 2d slices of HDF5 files π
π¦ SYNOPSIS π¦
h5topng [OPTION]... [HDF5FILE]...
π DESCRIPTION π
So. h5topng is a utility that makes images in PNG (Portable Network Graphics) format out of two-dimensional slices of datasets sitting inside HDF5 files. It's built for quick-and-dirty visualization of scientific data, and also for batch processing all of that via shell scripts. fr fr, it's the girl who shows up, does the job, and dips.
HDF5 is a free, portable binary format plus a supporting library, developed by the National Center for Supercomputing Applications at the University of Illinois in Urbana-Champaign. π« A single h5 file can hold multiple data sets; by default h5topng grabs the first dataset, but you can switch that up with the -d option, or by using the syntax HDF5FILE:DATASET. slay.
For a three- or four-dimensional dataset you must specify coordinates in one or two slice dimensions respectively to get a two-dimensional slice, and you do that via the -xyzt options. There's more options controlling stuff like the colormap and magnification. But honestly? The most basic usage is literally something like h5topng foo.h5, which outputs a file foo.png containing an image from the two-dimensional data in foo.h5. that's it. that's the whole thing. π
πΈ OPTIONS πΈ
-hβ Display help on the command-line options and usage.-Vβ Print the version number and copyright info forh5topng.-vβ Verbose output. This output includes the minimum and maximum values encountered in the data, which is useful to know for the-mMoptions. π-ofile β Send PNG output to file rather than to the filename with.h5replaced with.png(the default).-xix,-yiy,-ziz,-tit β This tellsh5topngto use a particular slice of a multi-dimensional dataset. e.g.-xcauses a yz plane (of a 3d dataset) to be used, at an x index of ix (where the indices run from zero to one less than the maximum index in that direction). Here, x/y/z correspond to the first/second/third dimensions of the HDF5 dataset. The-toption specifies a slice in the last dimension, whichever that might be. See also the-0option to shift the origin of the x/y/z slice coordinates to the dataset center.
Instead of specifying a single index as an argument to these options, you can also specify a range of indices in a Matlab-like notation: start:step:end or start:end (step defaults to 1). This loops over that slice index, from start to end in steps of step, producing a sequence of output PNG files (with the slice index appended to the filename, before the .png). π
-0β Shift the origin of the x/y/z slice coordinates to the dataset center, so that e.g.-0 -x 0(or more compactly-0x0) returns the central x plane of the dataset instead of the edge x plane. (-tcoordinates are not affected.) main character energy, honestly.-Xscalex,-Yscaley,-Sscale β Scale the x and y dimensions of the image by scalex and scaley respectively. The-Soption scales both x and y. The default is to use scale factors of1.0; i.e. the image has the same dimensions (in pixels) as the data. Linear interpolation is used to fill in the pixels when the scale factors are not1.0. π-sskewangle β Skew the image by skewangle (in degrees) to the left or right. The result is a parallelogram, with the leftover space in the (square) image filled with either black or white pixels, depending upon the color map. asymmetric queen π-Tβ Transpose the data (interchange the image axes). By default, the first (x) coordinate of the data corresponds to the columns, and the second (y) coordinate corresponds to the rows; transposition reverses this convention.-ccolormap β Use a color map colormap rather than the default gray color map (a grayscale ramp from white to black). colormap is normally the name of one of the color maps provided withh5topng(in the/usr/share/h5utils/colormapsdirectory), or can instead be the name of a color-map file.
Three useful included color maps are hot (black-red-yellow-white, useful for intensity data), bluered (blue-white-red, useful for signed data), and hsv (a multi-color "rainbow"). π If you use the bluered color map for signed data, you may also want to use the -Z option so that the center of the color scale (white) corresponds to zero.
A color-map file is a sequence of whitespace-separated R G B A quadruples, where each value is in the range 0.0 to 1.0 and indicates the fraction of red/green/blue/alpha. (An alpha of 0 is transparent and of 1 is opaque; this is only used for the -a option, below.) The colors in the color map are linearly interpolated as necessary to provide a continuous color ramp. π¨
-rβ Reverse the ordering of the color map. You can also accomplish this by putting a-before the colormap name in the-cor-aoption.-Zβ Center the color scale on the value zero in the data.-mmin,-Mmax β Normally, the bottom and top of the color map correspond to the minimum and maximum values in the data. Using these options, you can make the bottom and top of the color map correspond to min and max instead. Data values below or above this range will be treated as if they were min or max respectively. See also the-Zand-Roptions.-Rβ When multiple files are specified, set the bottom and top of the color maps according to the minimum and maximum over all the data. This is useful to process many files using a consistent color scale, since otherwise the scale is set for each file individually. consistency is key bestie π«Ά-Cfile,-bval β Superimpose contour outlines from the first dataset in the file HDF5 file on all of the output images. (If the contour dataset does not have the same dimensions as the output data, it is peridically "tiled" over the output.) You can use the syntaxfile:datasetto specify a particular dataset within the file. The contour outlines are around a value of val (defaults to middle of value range in file).-Afile,-acolormap:opacity β Translucently overlay the data from the first dataset in the file HDF5 file, which should have the same dimensions as the input dataset, on all of the output images, using the colormap colormap with opacity (from0for completely transparent to1for completely opaque) opacity multiplied by the opacity (alpha) values in the colormap. (If the overlay dataset does not have the same dimensions as the output data, it is peridically "tiled" over the output.) You can use the syntaxfile:datasetto specify a particular dataset within the file.
Some predefined colormaps that work particularly well for this feature are yellow (transparent white to opaque yellow), gray (transparent white to opaque black), yarg (transparent black to opaque white), green (transparent white to opaque green), and bluered (opaque blue to transparent white to opaque red). You can prepend - to the colormap name to reverse the colormap order. (See also -c, above.) The default for -a is yellow:0.3 (yellow colormap multiplied by 30% opacity). β¨
-dname β Use dataset name from the input files; otherwise, the first dataset from each file is used. Alternatively, use the syntaxHDF5FILE:DATASET, which allows you to specify a different dataset for each file. You can use theh5lscommand (included with hdf5) to find the names of datasets within a file. π-8β Use 8-bit (indexed) color for the PNG output, instead of 24-bit (direct) color (the default). (This shrinks the image size slightly, with some degradation in quality.) Not supported in conjunction with the-A(translucent overlay) option. π«
π BUGS π
Send bug reports to S. G. Johnson, stevenj@alum.mit.edu. he's listening, bestie, tell him everything. π§
π AUTHORS π
Written by Steven G. Johnson. Copyright (c) 2004 by the Massachusetts Institute of Technology.
okay that's the whole page, you ate that π
h5utils, March 9, 2002 β signing off, ily, go make some PNGs π¦β¨
π¦ where this page comes from
- debian bookworm: h5utils 1.13.2-1 Β· MIT
- debian trixie: h5utils 1.13.2-2 Β· MIT
- ubuntu noble: h5utils 1.13.2-1build3 Β· MIT
- ubuntu questing: h5utils 1.13.2-2
- ubuntu resolute: h5utils 1.13.2-2build1 Β· MIT
- ubuntu stonking: h5utils 1.13.2-2build2 Β· MIT
- Copyright (c) 2004 Massachusetts Institute of Technology
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms