Skip to content

nevali/tcg

Repository files navigation

This is 'tcg', a test-card (or test pattern) generator.

The intention is for tcg to be able to generate a variety of colour-accurate
test patterns at any practical resolution, at up to 16 bits per channel,
and stored in any of a number of formats.


To-do/outstanding issues
========================

* The actual Y/Cb/Cr values in colourmap.c are in need of review.

* YCbCr TIFF output does not properly set the colourimetric metadata.

* There is no 10-bpc output option.


Using tcg
=========

Run 'tcg -h' for usage information. There are command-line options to:

* Specify the type of test pattern to generate.

* The frame size (if you specify one dimension only, it is assumed to be a
  height, and the width will be calculated as (h * 16) / 9.

* The frame index or range (counted from zero) for multi-frame patterns.

* Split the frame into identical tiles.

You can write multiple output files in different formats for the same frame.
Prefix the filename with the format name (e.g., 'tiff-y16:myframe.tiff').

For example, to write a single frame in 16-bit TIFF format containing only
the luma (Y) channel, consisting of a UHDTV 8K image made up for a 4x4 grid
of the "EBU 75%" test pattern, you would invoke:

$ tcg -s 7680x4320 -T 4x4 -t ebu75 tiff-y16:frame.tiff


Percent-sequences are used to perform substitutions into filenames.

To include a literal '%' in a filename, write it as '%%'.

Currently only the '%d' sequence is supported, which is replaced with the
frame index. The format of this sequence is:

%[-][0][WIDTH]d

The '0' indicates zero-padding to the specified WIDTH. e.g., frame 1 with a
WIDTH of 4 would result in '0001' with zero-padding, '   1' without.

The '-' indicates that the frame number should be left-justified instead of
right-justified. If both '-' and '0' are specified, the '0' is ignored.

For example, for frame 15:

   %d     ->  '15'
   %04d   ->  '0015'
   %4d    ->  '  15'
   %-4d   ->  '15  '
   %-04d  ->  '15  ' 


If the filename does not contain any pattern, and multiple frames are
requested, the result will be output files containing all of the requested
frames. The precise effects of this are format-dependent. For raw formats,
all of the frames are simply appended to the file. For TIFF output, each frame
is written as a subpage in the TIFF. Single-file multi-frame JPEG2000 images
are written, but possibly not correctly -- most software seems unable to
process them (or even indicate the presence of any except the first frame).


Building from a git checkout
============================

You will need autoconf and automake, as well as the usual toolchain.

You need libtiff installed (including its -dev or -devel package, if that's
how you installed it) if you want TIFF output.

You need libjpeg and libjasper installed if you want JPEG2000 output.
Depending upon how libjasper has been built and installed, you may need to
explicitly provide the prefix to libjpeg.

$ autoreconf -i
$ ./configure
      [--with-libtiff=/prefix/of/libtiff]
      [--with-libjpeg=/prefix/of/libjpeg]
      [--with-libjasper=/prefix/of/libjasper]
$ make
$ sudo make install

About

Testcard generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages