Skip to content

Levels, Lossless Transformations, and Intervals

Compare
Choose a tag to compare
@bluescan bluescan released this 10 Jul 06:03
· 207 commits to master since this release

This release features additional image adjustments (levels, brightness, contrast), support for PKM and ETC-compressed textures, lossless image transformations for JPG files, support for intervals and interval-sets, improvements to command-line option parsing, plus many smaller features and some bug fixes. PBC = Possible Breaking Change.

Features

  • Brightness and Contrast adjustments for tPictures.
  • Levels adjustments for tPicture. Black, mid, and white points may be set independently or the mid-point can be computed for you.
  • Colour-frequency histograms (for various channels) computed for tPictures.
  • All image saving interfaces accept a save-parameters struct. The interfaces for the various image types is more unified.
  • Command line options parser now able to collect all parameters of a particular type in a single tParam object (PBC).
  • Changed the default compression setting for TGA files to None as RLE is not universally supported by other software (PBC).
  • tPrintf functions named consistently. Added convenient tPrintf functions for appending to tStrings (PBC).
  • Colour quantization functions available to tPicture class.
  • Math library supports computing greatest-common-divisor (tGCD) and least-common-multiple (tLCM).
  • Aspect-ratio API added. Supports all common print and screen aspect ratios.
  • Support for decode of more pixel formats. Specifically, ETC1, EACR11, EACR11S, EACRG11, EACRG11S, ETC2RGB, ETC2RGBA1, and ETC2RGBA.
  • Support pkm images. These may contain pixel data in any ETC, ETC2, or EAC encoding.
  • Support ETC encoded KTX and KTK2 files.
  • Support ETC encoded DDS files.
  • Channel swizzling support in tPicture.
  • Lossless JPG transformations (90 degree rotations and flips).
  • Intervals and interval-sets are now supported by the math module. Integral interval-sets are are able to accumulate intervals and maintain the simplest representation possible.
  • Conversions to/from string representations for tInterval and tIntervalSet.

Improvements and Fixes

  • Introduced an alternate mid-point gamma algorithm based on a base 10 power function. This one is not C1 discontinuous at gamma 1.
  • Fix palettized image class (tPaletteImage) when Wu quantization requested.
  • Ability to set an external pixel buffer for tPicture.
  • Changed the way picture adjustments work. Instead of using an 'original' pixel buffer, all functions starting with 'Adjust' must be called between AdjustmentBegin and AdjustmentEnd (PBC).
  • Allow fractional counts for the histograms generated in some tPictures. Alpha is not considered. For example, a red at index 200 with alpha 128 would only add 0.5 to that index.
  • Intensity can now be computed for specific colour channels. tPicture adjustments can be performed on chosen colour channels instead of forcing RGB.
  • Added predefined 'one' vectors for all vector classes.
  • Added filesystem friendly time string format. No colons/dots/spaces.
  • Cleaned up the Save interfaces for the tImage types that allow specification of an 'auto' pixel-format.
  • Command-line parsing. tParam now able to collect all parameters no matter how many of them there are. To do this set the parameter number to 0. Escape sequences now use hat (^) instead of backslashes. Makes using backslashes for file paths easier (PBC).
  • Fix issue with GetProgramPath on Linux. Return value from readlink is now checked.
  • tFileInfo needed, and now has, a copy constructor. One of the members is a tString so a memcpy is no good.
  • Made the image saving interface more consistent. Every tImaageNNN class that supports saving now uses a SaveParams structure. The parameters inside are dependent on the particular image file format and what it supports (PBC).
  • Improved colour-space handling for QOI images. Fixed QOI colour-space names (PBC).
  • Added resample and edge-mode names.
  • More consistent tPrintf naming for functions taking in va_list. Print functions returning tString no longer overloaded to avoid ambiguity. Added 'append' versions of the print functions. These are prefixed with 'tsa' (BPC).
  • Added tFindFirstSetBit calls for unsigned integral types.
  • Improved AlphaBlendColour by allowing you to specify the RGB channels and explicit final-alpha value.
  • Spread and intensity functions added to tPicture.
  • Fixed possible memory overrun while demuxing some webp files.
  • Allow ill-formed dds files to be loaded. A new strict-loading flag has been added. If the flag is not set we allow none of the dds-header format-flags to be set and proceed by assuming the FourCC is correct and sufficient.
  • Reduced windows synonym define pollution by using a Win prefix (BPC).
  • Background colour preserved by webp loading code. Any invalid demux regions that extend ouside of canvas area are skipped. The background colour may now be inspected after a webp load.
  • Implemented greatest-common-divisor (tGCD) and least-common-multiple (tLCM). tGCD is used by the aspect-ratio functions. A fairly extensive list of common screen and print aspect-ratios are supported.
  • Fixed row order while loading qoi images. Fixed saving of qoi images so rows not reversed. Because both load and save had reveresed rows, this 'upside-down image' bug wasn't noticed right away.
  • Changed the tScript string write-atom calls to not do tuple-detection. In all cases if a space is present, quotes are added. It was a problem before if, for example. a path was stored in an atom-string and the path had ()s in them. Now the writing code calls WriteRaw instead for tuples and paths with spaces always get surrounded by quotes.
  • Support (less common) atc file extension for ASTC files.
  • Fix DDS, KTX, and KTX2 loading when dimensions not multiple of 4.
  • Optional gamma or sRGB compression while loading PKM images. No auto-gamma by default for PKM files. There are too many ETC2 files in the wild not set to sRGB pixel format that in fact are in sRGB space.
  • Safer detection for when an ill-formed dds file does not have enough data. We no longer try to read into uninitialized memory.
  • Tacent component type (tcomp) now renamed to comp_t. This frees up tComp to be used for the Tacent component enum, and tCompBit to be used for the component bits enum (PBC). Functions for determining if a component is a colour, vector, or matrix component.
  • tPicture colour channel swizzling and colour-spead functions.
  • Renamed GetCompName to GetComputerName so it's not confused with component (BPC).
  • Load option to swap Red and Blue when decoding KTX files.
  • Improved how LDR and HDR buffers are handled by the DDS loader. Dealing with colour-space conversions now always happens after decode.
  • Pulled out the pixel-format decode function from the DDS loader. This will be used for more than just tImageDDS. It's basically the same code for KTX, ASTC, PKM, etc.
  • Separate decode functions based on pixel-format being either BC, ASTC, or Packed.
  • Colour 'profiles' introduced and are being used by image loaders. A colour profile specifies what colour space the colour channels are in and whether they are LDR (0.0 to 1.0) or HDR.
  • If a non sRGB pixel-format detected for dds and ktx/ktx2 files with ASTC data, the HDR (lin alpha) profile is selected.
  • Prefer sRGB for UNORM pixel formats in dds files.
  • tImageASTC supports auto-gamma.
  • All packed, block decompression, and astc code now shared by all image formats that support those formats.
  • sRGB assumed more often based on content of real ktx files. In the wild, many non-sRGB pixel-format images are actually sRGB.
  • The VK (ktx2) formats are obeyed more closely in terms of the colour profile specified by the VK format.
  • EAC encoded PKM files default to the sRGB colour profile.
  • Default to no gamma-correction for PKM files. The linear test files have incorrect sRGB data in them and I want them displayed correctly but don't want to just default to the sRGB profile.
  • Cleanup ProcessHDRFlags when loading ASTC, DDS, KTX, and KTX2 files. Add some asserts to make sure the decoded pixel buffers are the ones we expect.
  • Added versioning to ETCDec library.
  • Ability to detect imperfect lossless transform results before performing the transform on a tImageJPG.
  • Added a tString member function (RemoveAnyNot) that allows you to specify a string of characters that will not be removed. Everything else will. This is useful if you want to take an input string and make it well-formed by limiting what characters it may contain.
  • Added Count function to tInterval and tIntervalSet. Can only work over discrete (integral-type) domains.
  • Support the less common dds formats R8G8B8 and R8G8B8A8. The more common ones are B8G8R8 and B8G8R8A8 that were previously supported.
  • Fixed gif encoder. It was possible for it to set the transparency flag in the graphics control extension block when encoding fully opaque images. This was fixed in two ways: a) The extension block is no longer included by setting the frame duration to 0 for single-frame images, and b) even if the extension block were included, it now checks the bgindex to see if it should write a false for the transparency bit/flag.
  • Auto mode for alpha threshold when saving GIFs.

Full Changelog: v0.8.15...v0.8.16