Image files are used to save fractal images which we have computed; but there is much more information which we typically want to save in practice, and keeping this co-ordinated with the image files can be a chore.
FracTest takes an innovative approach by saving all this information in one file, which can make life much easier. This page describes how it works.
When a fractal image is computed, we obviously want to be able to save it in a file. However, the image itself isn't much use for anything other than its looks; if you see an interesting saved image, and want to re-create it, for example to explore within the image, you would need to know the co-ordinates and other parameters it was created from. Even with the co-ordinates, we can re-render the image, but this might take a long time.
There are therefore many types of information we might wish to save, beyond just the computed image:
An innovation of FracTest is that it stores all of this information in
a single PNGPortable Network Graphics
Article on the PNG lossless image file format. (Wikipedia)
https://en.wikipedia.org/wiki/Portable_Network_Graphics file, every time you save
to a PNG file. This makes it very easy to explore on from a set of saved
images, as each image will contain
everything needed to re-create it efficiently. Since PNG is a
lossless format, this also acts as a perfect archive of the image
itself.
Since PNG files can be slow and unwieldy, FracTest also supports
exporting to the lossy JPEGJPEG
Article on the JPEG lossy image file format. (Wikipedia)
https://en.wikipedia.org/wiki/JPEG format, for
uploading to web servers and the like. However, the meta-data
described above is not saved
in JPEG files — since JPEG is lossy, it would be impossible to
accurately restore a computation state from it. So bear in mind
that JPEG files are for export only, not for your own image archive.
Since the saved PNG file contains all the related information about a fractal view, it can serve multiple purposes.
The simplest thing to use a PNG for is, of course, saving the generated fracal view itself. PNG Is excellent for this; as it saves images using lossless compression, the image is stored efficiently, but with absolutely no loss of quality.
Since the full view parameters are stored in each saved PNG file, re-creating the fractal view is as simple as loading the image file into FracTest. Since this gives us the full parameters, colour palette, etc., you can just use the controls to make derivations of that view; for example, re-framing, rendering at a different resolution, or zooming to explore further in.
A PNG file may contain the state of the computation which was in progress, or which had completed, when the image was saved. This state allows the pixel values stored in the image to be loaded into FracTest, even when only some pixels are valid (e.g. when the computation is incomplete, particularly with progressive rendering), so that they can be displayed without needing to be re-computed.
This allows two useful operations:
This ability works particularly well with the history; stepping back and forth through the history, while displaying slow fractal images, allows work to continue at each step, rather than having to be re-started.
It is also essential for the checkpointing feature; if a calculation fails due to a crash, power cut, etc., it can be re-started from the last saved checkpoint.
Each PNG file contains the full specification of the colour palette used to create it; you can load this palette into your current view with the menu command "Palette" → "Load Palette". After loading, re-render to see the new view computed with the loaded palette.
With this feature in mind, PNG files can be used to store interesting palettes, with the image in each file serving as an example of its use.
Bear in mind that you may need to tune how the palette is applied to the view for good results.
Since JPEG is a lossy format, it would not be possible to restore a fractal computation from it. Also, it's not appropriate as an archive format for fractal images (it's great for photographs, which is what it was designed for). Hence, we do not store any meta-data (beyond the usual image meta-data) in a JPEG file; as a result, it will not be possible to re-create a fractal view from a JPEG file.
Since PNG is relatively slow, and the files can be large, we support export to JPEG format for uploading to web sites, and the like — JPEG is perfectly adequate for web viewing. Note that this is referred to as "export", rather than "save", to emphasise the difference. Your master copies of each generated fractal view should always be saved as PNG files.
Every time an image is saved to a PNG file, FracTest saves two sets of
meta-data along with it. In the standard meta-data "tEXt
"
chunk, we save all of the parameters used to create the image; and in a
non-standard "ftCS
" chunk, we save the states
of all the tiles used in the computation.
tEXt
" ChunkThe "tEXt
" chunk contains all the meta-data paramaters
describing how the view was created.
All of the the usual PNG meta-data is there as normal. Most of
the fields we create are prefixed "fractal-
",
except Software
, Title
, Author
,
and Comment
. The specific
fields saved vary by FracTest version, and also depend on whether the
render completed; but will typically include:
Software
, Title
,
Author
Comment
fractal-data-version
,
fractal-data-precision
fractal-formula,
fractal-rep-func, fractal-maxiter, fractal-precision, fractal-bailout,
fractal-centre-x, fractal-centre-y, fractal-radius-x, fractal-radius-y
fractal-config-xxx
fractal-palette-xxx
fractal-render-xxx
fractal-stats-xxx
fractal-view-rendered
A typical dump of this chunk will look like this:
ftCS
" ChunkThe "ftCS
" (FracTest comp state) chunk is used to save the
state of the computation. This is basically a dump of the tiles configuration
(numbers and sizes of tiles), and the states of each tile. This is in an
internal format, which is likely to change between FracTest versions.
If the "ftCS
" chunk is missing, or is not compatible with
the current state of FracTest, then it is simply ignored, and the
image will be re-computed from scratch.
You can see the fractal parameters in the "tEXt
" chunk
of a PNG file with a tool which displays the PNG meta-data.
Unfortunately, a lot of tools, such as the Windows file properties
box, only show the most basic meta-data, and not the fractal parameters.
However, other tools can do it. For example, if you have
ImageMagickImageMagick
An excellent set of command-line tools for image manipulation. (ImageMagick)
https://www.imagemagick.org/script/index.php, the following command
will work:
This will list all of the properties in the "tEXt
" chunk of
the given file.
Note that this method does not show the contents of the "ftCS
"
chunk used to store the computation state, or even its existence. Since
"ftCS
" is a non-standard chunk, no off-the-shelf tool will
display it.