EXTERNAL
|
Languishings | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
• • • |
"Myndex" is the long-standing username/pen-name for a Hollywood, Ca. based film-industry professional. He is an author, researcher, and subject matter expert in filmmaking, digital imaging, color science, and visual accessibility. The Myndex username also is used on GitHub, StackOverflow, and a number of other technical sites, as well as at www.myndex.com . He also writes using additional pen names on a wide variety of topics including media, design, politics, social policy, constitutional law, civil rights, spirituality, and progressive humanism.
While the Myndex username is rarely used by others, there does happen to be a European punk rock group that uses the name, and an artist on "Deviant Art" though there is no relationship. Also, I recently discovered the term "Myndex" seems to be somehow related to certain demographic studies in Austria.
Pronunciation
For the record, the correct pronunciation of Myndex is:
mind - ex
\ ˈmīn-ˌdɛks \
When George Eastman invented the word "Kodak"
one of his criteria was that "it won't be mispronounced".
I guess I missed that day. Ooops.
MYNDEX User Box Templates Page
Somers' Law
edit- "All technology becomes obsolete eventually"
For an expanded look at this concept, please see "The Laws of Technodynamics"
CORE VALUES
editTRUTH illuminating FAIRNESS • JUSTICE • LIBERTY
editConflict of Interest Statement:
edit- My interests are shown here on my user page. At the bottom of this page is a selection of some of my articles published elsewhere, demonstrating my diversity of interests and viewpoint. I do post things here that I am substantially interested in, such as color, light, filmmaking, etc.
- If you have any questions about anything I posted, please feel free to reach out to me on my talk page and I will respond as soon as practical.
My only allegiance is to truth and accuracy.
edit- My involvement with Wikipedia is completely pro bono in nature.
- All posts, edits, and content I provide are intended for the common good, and I receive no compensation of any kind from any entity for my involvement here, nor do I perform any edits for any entity other than myself and the Wikipedia foundation.
MAIN SUBJECTS OF INTEREST
edit- Everything
- Visual perception, light, and color research
- Digital imagery, chemical imagery, artificial imagery, manually created imagery (aka painting)
- Filmmaking: directing, editing, writing, producing, acting, cinematography, and not necessarily in that order
- Sound, sound design, acoustics, music, composition
- Progressive politics, civil liberties, civil rights, constitutional law, election theory, Condorcet
- Writing, creating, inventing, producing, and generally doing a lot of stuff.
TODAY'S CONTROVERSY
editPhi Alternate Expression
editThe formula for phi can be reduced to a positive exponent, multiplication, and addition:
This is clear and easy to remember, demonstrates interesting relationships, namely that phi approximates the Fibonacci ratio starting with the FIFTH pair, and is less obtuse than the formula as shown in the article. This can also improve computational efficiency (of admittedly marginal importance). Here is an example for javascript:
const phi = Math.pow(5, 0.5) * 0.5 + 0.5; // or the version below for modern JS, even faster const phi = 5 ** .5 * .5 + .5;
Phi Equation Version | Speed
higher numbers are better |
Source |
---|---|---|
phi = Math.pow(5, 0.5) * 0.5 + 0.5;
|
2454188.0 Ops/sec | Somers Simplification |
phi = (Math.sqrt(5) + 1) / 2;
|
2464804.0 Ops/sec | Academic Standard |
phi = (Math.sqrt(5) + 1) * 0.5;
|
2483684.0 Ops/sec | |
phi = Math.phi;
|
2491832.0 Ops/sec | JS Built-In Math |
phi = 5 ** 0.5 * 0.5 + 0.5;
|
5371123.0 Ops/sec | Somers Optimization |
As we can see from the preferred embodiment of phi = 5**0.5*0.5+0.5;
it is more than twice as fast as the next candidate, which is the built-in Math.phi
So, what's controversial? I put this in the Golden Ratio article only to have Ovinus revert it. He claimed among other things that it was "original research".
Okay fine, then as original research, I hereby I call this the Somers Golden Simplification. ... So there.
Yesterday's Controversy
editHow much time would you devote to arguing over an "s" ?
For me, apparently, too much time. there is an article here on Wikipedia called RGB color space but it relates to a group of color spaces, many of which have "RGB" in the name. The problem is that by titling the article as a singular, when it is not a mass noun and when it is a group of similarly named, but INCOMPATIBLE things, it leads to confusion. That is, those that are not experts in color science may not realize that each RGB color space is unique and not interchangeable.
That the title "RGB color spaces" needs to be plural has an obvious reason, and one I failed to state initially perhaps due to its obviousness, that being the fact each RGB color space in the group of RGB color spaces is incompatible with each other and not interchangeable without some transform or gamut mapping. Even Rec709 and sRGB which share the same primary and whitepoint coordinates still use different TRCs, and different reference/display characteristics. Some RGB spaces use imaginary primaries that can not be created as real colors. Some RGB color spaces use a simple gamma, some use a piecewise parametric TRC. Some use a D illuminant white point, some have a CCT white point that isn't even on the Planckian locus. It needs to be clear that "RGB color space" is not a generic and interchangeable thing, it is a group of things each with specific characteristics and requiring transforms to convert from one to another, many of which are non-trivial.
Do you have an opinion? Chime in at talk: RGB color space
Wiki Scratchpad
edit10 bit png
edit- A 10bit png format with all the advantages of png, but a bit depth to match many current video and HDR formats.
- Should compress similarly to an 8bit RGBA png. First three bytes are not unlike an 8 bit image, then the one LSb/alpha byte, which might not compress as small as a typical alpha, but overall this scheme should be substantially more efficient than 10-in-16.
- So long as the decoder supports
sBIT
, this should be backwards compatible, with the caveat that images with truncated LSbs may have artifacts. - And finally, though tests need to be run, this seems like an efficient way to handle 10bit images as far as the compression and total data size is concerned.
10 bit png (Proposed) | ||||||||||||||||||||||||||||||||||
R 8 MSb |
G 8 MSb |
B 8 MSb |
A 2bit |
R 2LSb |
G 2LSb |
B 2LSb | ||||||||||||||||||||||||||||
┌─────────────┐ | ┌─────────────┐ | ┌─────────────┐ | ┌─┐ | ┌─┐ | ┌─┐ | ┌─┐ | ||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | |||
31 | 24 | 23 | 16 | 15 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |||||||||||||||||||||
Meta Chunks: | IHDR | sBIT | TENB | TENB Flags Define What's put in Alpha | ©2023 Myndex Research | |||||||||||||||||||||||||||||
Values: | Bit Depth: 8 Color Type: 6 |
R: 8, G: 8, B: 8, A: 2 (Mask Alpha's 6 LSb) |
ARGB: 2222 ARGB: 2111 ARGB: 2000 |
2 bit Alpha & 2 LSb of each R,G,B 2 bit Alpha & 1 LSb and 1 MSb of R,G,B 2 bit Alpha & 2 MSb of R,G,B (0 LSb) | ||||||||||||||||||||||||||||||
YPQUV png
editThis converts 12bit per channel PQ RGB to YUV, where Y is PQ gamma at 12 bits, and the U and V are 10 bits each.
The advantage is maintaining the essential luminance resolution, but compacting the full PQ signal into an 8bpc png container.
Coefficients are applied to the gamma encoded RGB tuples for computational efficiency, as is common practice in broadcasting.
In the layout below, the V is inverted to -V, essentially putting blue on top. In this way, the truncated U Y -V channels very roughly fit R G B, for a semi-viewable image at the file system level.
Advantages
- A 12 bit PQ image in an 8bpc container.
- Uses standard png compression
- YPQ is created with the PQ gamma for computational simplicity
- UV is used as it is a common, simple transform.
YPQUV png (Proposed) | ||||||||||||||||||||||||||||||||||
12bit Y, 10bit U & V | ||||||||||||||||||||||||||||||||||
MODE 0 (Default YPQUV) | ||||||||||||||||||||||||||||||||||
YPQ 8 MSb |
U 8 MSb |
V 8 MSb |
YPQ 4 LSb |
U 2 LSb |
V 2 LSb | |||||||||||||||||||||||||||||
┌──────────────┐ | ┌──────────────┐ | ┌──────────────┐ | ┌────┐ | ┌─┐ | ┌─┐ | |||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | |||
31 | 24 | 23 | 16 | 15 | 8 | 7 | 6 | 5 | 2 | 1 | 0 | |||||||||||||||||||||||
MODE 1 (UY-V for Pseudo-Compatible Viewing) | ||||||||||||||||||||||||||||||||||
U 8 MSb |
YPQ 8 MSb |
-V 8 MSb |
U 2 LSb |
YPQ 4 LSb |
-V 2 LSb | |||||||||||||||||||||||||||||
┌──────────────┐ | ┌──────────────┐ | ┌──────────────┐ | ┌─┐ | ┌────┐ | ┌─┐ | |||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | |||
31 | 24 | 23 | 16 | 15 | 8 | 7 | 6 | 5 | 2 | 1 | 0 | |||||||||||||||||||||||
Chunks: | IHDR | sBIT | Mod | YPUV | YPUV Flags Define What's put in Alpha | ©2023 Myndex Research | ||||||||||||||||||||||||||||
Values: | Bit Depth: 8 Color Type: 6 |
R: 8, G: 8, B: 8, A: 0 R: 8, G: 8, B: 8, A: 0 R: 8, G: 8, B: 8, A: 2 R: 8, G: 8, B: 8, A: 4 |
0 1 2 3 |
Y:4, U:2, V:2 U:2, Y:4, V:-2 A:2, Y:2, U:2, V:2 A:4, Y:4 |
Y's 4 LSb, U's 2 LSb, V's 2 LSb U's 2 LSb, Y's 4 LSb, V's inverted 2 LSb 2 bit Alpha, Y's 2 LSb, U's 2 LSb, V's 2 LSb 4 bit Alpha, Y's 4 LSb, U and V are 8 bit (not in alpha). | |||||||||||||||||||||||||||||
YPQUV 422 png
editThis converts 12bit per channel PQ RGB to YUV, where Y is PQ gamma at 12 bits, and the U and V are 12 bits each, but only U or V is present on any given pixel.
The advantage is maintaining the essential luminance resolution, but compacting the full PQ signal into an 8bpc png container, and maintaining higher color depth than the previous method, trading off for spatial resolution instead.
Coefficients are applied to the gamma encoded RGB tuples for computational efficiency, as is common practice in broadcasting.
Unlike the above version (12 10 10), this version will not be particularly visible in legacy viewers, but it does retain a full 8 bit alpha channel. It should compress well as the vertically adjacent pixels will both be either U or V type, so though the horizontal adjacent pixels alternate U or V, the prefilter should in theory select the vertically adjacent pixel for the deltas.
UVUVUV
UVUVUV
An alternate scheme is, horizontally UUVVUUVV, and offsetting each line by 1 pixel as:
The stagger should progress right:
UUVVUUVV
VUUVVUUV
VVUUVVUU
UVVUUVVU
This way a U (or V) will always have a U (or V) either above or to the left, and should give the prefilter more options for which pixel to select for the deltas.
Advantages
- A 12 bit PQ image in an 8bpx container.
- Uses standard png compression
- U pixels are aligned vertically, as are V, which should help compression.
- Alternately, UU and VV pairs alternate, with a march right per line
- YPQ is 12 bits, created with the PQ gamma for computational simplicity
- UV is used, as it is a common, simple transform.
- U and V are each 12 bits signed (or offset?) and alternate each pixel, or a marching pair
- The full 8 bit Alpha is maintained.
YPQUV 422 png (Proposed) | |||||||||||||||||||||||||||||||||||
12bit Y, 12bit interleaved U & V, no alpha | |||||||||||||||||||||||||||||||||||
YPQ ODD U: odd pixels, or staggered pairs UU offset +1 right per line | |||||||||||||||||||||||||||||||||||
YPQ 8 MSb (unsigned) | YPQ 4 LSb | U 4 MSb (signed) | U 8 LSb | ||||||||||||||||||||||||||||||||
┌──────────────┐ | ┌─────┐ | ┌─────┐ | ┌──────────────┐ | ||||||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||
23 | 16 | 15 | 12 | ± | 8 | 7 | 0 | ||||||||||||||||||||||||||||
YPQ EVEN V: even pixels, or staggered pairs VV offset +1 right per line | |||||||||||||||||||||||||||||||||||
YPQ 8 MSb (unsigned) | YPQ 4 LSb | V 4 MSb (signed) | V 8 LSb | ||||||||||||||||||||||||||||||||
┌──────────────┐ | ┌─────┐ | ┌─────┐ | ┌──────────────┐ | ||||||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||
23 | 16 | 15 | 12 | ± | 8 | 7 | 0 | ||||||||||||||||||||||||||||
YPQUVA 422 png (Proposed) | |||||||||||||||||||||||||||||||||||
12bit Y, 12bit interleaved U & V, 8 bit Alpha | |||||||||||||||||||||||||||||||||||
YPQ ODD U: odd pixels, or staggered pairs UU offset +1 right per line | |||||||||||||||||||||||||||||||||||
YPQ 8 MSb (unsigned) | YPQ 4 LSb | U 4 MSb (signed) | U 8 LSb | Alpha 8 bits | |||||||||||||||||||||||||||||||
┌──────────────┐ | ┌─────┐ | ┌─────┐ | ┌──────────────┐ | ┌──────────────┐ | |||||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | ||||
31 | 24 | 23 | 20 | ± | 16 | 15 | 8 | 7 | 0 | ||||||||||||||||||||||||||
YPQ EVEN V: even pixels, or staggered pairs VV offset +1 right per line | |||||||||||||||||||||||||||||||||||
YPQ 8 MSb (unsigned) | YPQ 4 LSb | V 4 MSb (signed) | V 8 LSb | Alpha 8 bits | |||||||||||||||||||||||||||||||
┌──────────────┐ | ┌─────┐ | ┌─────┐ | ┌──────────────┐ | ┌──────────────┐ | |||||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | ||||
31 | 24 | 23 | 20 | ± | 16 | 15 | 8 | 7 | 0 | ||||||||||||||||||||||||||
Meta Chunks: | IHDR | Mod | YPUV | Meaning o YPUV Mode Level | ©2023 Myndex Research | ||||||||||||||||||||||||||||||
Values: | Bit Depth: 8 Color Type: 6 |
8 9 10 11 |
"Y,U1,V2" "Y,UU,VV" "Y,U1,V2,A" "Y,UU,VV,A" |
All odd pixels on a line are U, all even pixels are V Pixel interleaved cycle of 4 lines: UUVV — VUUV — VVUU — UVVU Same as 8 with alpha Same as 9 with alpha | |||||||||||||||||||||||||||||||
U/V Pixel Interleave Schemes | |||||||||||||||||||||||||||||||||||
line | Vertical Align | line | Staggered ⇨ Pairs | ||||||||||||||||||||||||||||||||
1 2 3 4 |
U V U V U V U V U V U V U V U V U V U V U V U V |
1 2 3 4 |
U U V V U U V V V U U V V U U V V V U U V V U U U V V U U V V U |
Alternate
editYPQUV 422 png | |||||||||||||||||||||||||||||||||||
12bit Y, 12bit interleaved U & V | |||||||||||||||||||||||||||||||||||
YPQ ODD U: odd pixels, or staggered pairs marching right (offset +1 per line) | |||||||||||||||||||||||||||||||||||
YPQ 8 MSb (unsigned) | U 8 MSb (signed) | YPQ 4 LSb | U 4 LSb | Alpha 8 bits | |||||||||||||||||||||||||||||||
┌──────────────┐ | ┌──────────────┐ | ┌─────┐ | ┌─────┐ | ┌──────────────┐ | |||||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | ||||
31 | 23 | 15 | 11 | 7 | 0 | ||||||||||||||||||||||||||||||
YPQ EVEN V: even pixels, or staggered pairs marching right (offset +1 per line) | |||||||||||||||||||||||||||||||||||
YPQ 8 MSb (unsigned) | V 8 MSb (signed) | YPQ 4 LSb | V 4 LSb | Alpha 8 bits | |||||||||||||||||||||||||||||||
┌───────────────┐ | ┌───────────────┐ | ┌─────┐ | ┌─────┐ | ┌───────────────┐ | |||||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | ||||
31 | 23 | 15 | 11 | 7 | 0 | ||||||||||||||||||||||||||||||
Meta Chunks: | IHDR | YPUV | U/V Pixel Interleave Schemes | ©2023 Myndex Research | |||||||||||||||||||||||||||||||
Values: | Bit Depth: 8 Color Type: 6 |
"Y,Uodd,Veven" | line | Vertical Align |
line | Staggered ⇨ Pairs ⇨ | |||||||||||||||||||||||||||||
1 2 3 4 |
UVUVUV UVUVUV UVUVUV UVUVUV |
1 2 3 4 |
UUVVUUVV VUUVVUUV VVUUVVUU UVVUUVVU |
Mini Float with Dynamic Bias png
editWORK IN PROGRESS
Still working on denormalized values vs normalized ones. I need sleep before I can finish that.
A mini float format wedged into an 8 bit per channel RGBA png. Each 8 bit RGB channel has 6, 7, or 8 bits mantissa with the remaining bits for the LSb of the exponent. Then the two MSb of each exponent are placed in what is normally the alpha channel, into the 6 LSbs of that channel.
In the repurposed alpha, the two MSbs are a 2 bit bias selector, then the 2 MSbs of each RGB channel exponent/sign bit.
Asymmetrical image-global bias, with per-pixel control of one of four bias values. Default bias values depend on the number of exponent bits.
2, 3, or 4 bit exponent per channel, then 2 bit bias select to select one of 4 preset image-wide bias values (see chart)
A sign bit can be used with a 2 or 3 bit exponent. Otherwise, the values are unsigned. This table shows the number of mantissa bits per exponent/sign configuration.
Mntsa bits |
Expnt (Base 2) |
Signed/ Unsigned |
Efctv Mntsa |
Efctv Expnt |
B 1 |
I 2 |
A 3 |
S 4 |
Range Per Bias Matrix 1 thru 4 | |
---|---|---|---|---|---|---|---|---|---|---|
8 | 2 (4) | Unsigned | 9 | ~ 4 | 9 | 7 | 5 | 3 | + 0.000007629394531 to + 7.9921875 | |
7 | 2 (4) | Signed | 8 | ~ 4 | 9 | 7 | 5 | 3 | ± 0.000015258789063 to ± 7.984375 | |
7 | 3 (8) | Unsigned | 8 | ~ 5 | 17 | 12 | 7 | 2 | + 0.000000059604645 to + 255.5 | |
6 | 3 (8) | Signed | 7 | ~ 5 | 17 | 12 | 7 | 2 | ± 0.00000011920929 to ± 255 | |
6 | 4 (16) | Unsigned | 7 | ~ 6 | 33 | 22 | 11 | 1 | + 0.000000000001819 to + 130,560 | |
"Effective Exponent" includes bias |
Efctv Mntsa |
Efctv Expnt |
BIAS 4 |
Range Per Bias 4 Only |
---|---|---|---|
9 | ~ 4 | 3 | + to + 7.9921875 |
8 | ~ 4 | 3 | ± to ± 7.984375 |
8 | ~ 5 | 2 | + to + 255.5 |
7 | ~ 5 | 2 | ± to ± 255 |
7 | ~ 6 | 1 | + to + 130,560 |
TO DO work on the denormalized values.
Bias is always subtracted so a negative bias value would move the exponent farther positive. Bias values overlap toe a degree.
So with an exponent of 2 and a bias of 2, we get 1, and then exp 3/bias 2 = 2. I.e. zero or positive exponents have +1 added.
Therefore a bias of 1 or 0 equals the exponent, which gives us an opportunity for special rules.
Note: normalized versus denormalized numbers needs to be worked out.
- In signed mode, each individual RGB channel can be either positive or negative.
- The sign bit, if it exists, is always adjacent to the MSb of the mantissa.
- Apply a bitwise OR between the flag and the MSb (flag|MSb) which will always show sign for the number, 1==(+) 0==(-), regardless of mode.
The full mantissa occupies each RGB channel. For mantissas of 7 or 6 bits, the MSbs are either LSbs of the exponent and/or a sign bit.
Significand (Mantissa) is 6,7, or 8 bits plus 1 implied.
Base, scale, and the four bias can be set in the MFLT chunk.
- Default Base 2, scale 1.0,
- Bias matrix is based on mantissa bit depth
- In signed mode, the sign bit is adjacent the top MSb of the mantissa.
- caveat: values if a given pixel is lower than can be realized by the current bias, the higher channel has priority, and the lower channel will be one of (in order of precedence)
- Clipped to a predetermined black level (set in MFLT chunk).
- Clipped to the bottom of the bias range
- Clipped to 0
- Encoder can selectively give priority to lower colors and resolve edge-case conflicts by clamping the overs to a preset value.
- The MFLT chunk should have an image-wide flag for signed/unsigned.
- An image-wide scale factor is in the MFLT chunk, and can be used to compress the distance between values for better tracking.
Considerations
editIt also could be useful (or might be necessary) to have a separate base(s) for signed and unsigned or the different bit depths.
Summary
- Effective precision of an 11 bit float (2,3,4 bit exponent with 9,8,7 bit mantissa)
- Maps to an 8 bit per channel png (RGBA) container.
- Expected to compress well using the standard png compression schemes.
- Arbitrary base supported (image wide)
- Scale factor supported (image wide)
- Adjustable bias (image wide) dynamically selectable (per pixel).
- Precision is achieved by:
- Asymmetric bias to maximize useful range for images.
- The three RGB tuples are likely to be in the range of a given bias,
- encoder can resolve edge case conflicts by clamping negatives to a preset or 0 if a high value is present or vice versa, with minimal issues.
- Asymmetric bias to maximize useful range for images.
Mini Float png (Proposed) | ||||||||||||||||||||||||||||||||||
Optimized for RGB image data and png compression 11~12 bit effective precision, with dynamic asymmetrical bias | ||||||||||||||||||||||||||||||||||
Mode 0 Unsigned Float 2 bit exponent, 8 bit mantissa + 1 bit implied, 2 bit bias select | ||||||||||||||||||||||||||||||||||
R 8 bit significand |
G 8 bit significand |
B 8 bit significand |
Bias Select |
R exp MSb |
G exp MSb |
B exp MSb | ||||||||||||||||||||||||||||
┌───────────────┐ | ┌───────────────┐ | ┌───────────────┐ | ┌─┐ | ┌─┐ | ┌─┐ | ┌─┐ | ||||||||||||||||||||||||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | |||
31 | 24 | 23 | 16 | 15 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |||||||||||||||||||||
Mode 1a Signed float 2 bit exponent + 1 sign bit, 7 bit mantissa + 1 bit implied, 2 bit bias select Mode 1b Unsigned float 3 bit exponent, 7 bit mantissa + 1 bit implied, 2 bit bias select |
||||||||||||||||||||||||||||||||||
R Ex/ |
R 7 bit significand |
G Ex/ |
B 7 bit significand |
B Ex/ |
B 7 bit significand |
Bias Select |
R exp MSb |
G exp MSb |
B exp MSb | |||||||||||||||||||||||||
± | ┌────────────┐ | ± | ┌────────────┐ | ± | ┌────────────┐ | ┌─┐ | ┌─┐ | ┌─┐ | ┌─┐ | |||||||||||||||||||||||||
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | |||
31 | 30 | 24 | 23 | 22 | 16 | 15 | 14 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||||||||||||||||||
Mode 2a Signed float 3 bit exponent + 1 sign bit, 7 bit mantissa + 1 bit implied, 2 bit bias select Mode 2b Unsigned float 4 bit exponent, 7 bit mantissa + 1 bit implied, 2 bit bias select |
||||||||||||||||||||||||||||||||||
R Exp/ |
R 6 bit significand |
G Exp/ |
B 6 bit significand |
B Exp/ |
B 6 bit significand |
Bias Select |
R exp MSb |
G exp MSb |
B exp MSb | |||||||||||||||||||||||||
LS | ± | ┌──────────┐ | LS | ± | ┌──────────┐ | LS | ± | ┌──────────┐ | ┌─┐ | ┌─┐ | ┌─┐ | ┌─┐ | ||||||||||||||||||||||
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | |||
31 | 30 | 29 | 24 | 23 | 22 | 21 | 16 | 15 | 14 | 13 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |||||||||||||||
Chunks: | IHDR | sBIT | MFLT | MFLT | ||||||||||||||||||||||||||||||
Values: | Bit Depth: 8 Color Type: 6 |
R:8,G:8,B:8,A:0 | MODE 0 R 8b G 8b B 8b Bias R2x G2x B2x |
Unsigned Base: 2.0 Bias: 9, 7, 5, 3 Scale: 1.0 | ||||||||||||||||||||||||||||||
©2023 Myndex Research | R:8,G:8,B:8,A:0 | MODE 1 R1e7 G1e7 B1e7 Bias R2e G2e B2e |
Signed SBase: 2.0 SBias: 9, 7, 5, 3 SScale: 1.0 Unsigned UBase: 2.0 UBias: 17, 12, 7, 2 UScale: 1.0 | |||||||||||||||||||||||||||||||
R:8,G:8,B:8,A:0 | MODE 2 R2e6 G2e6 B2e6 Bias R2e G2e B2e |
Signed SBase: 2.0 SBias: 17, 12, 7, 2 SScale: 1.0 Unsigned UBase: 2.0 UBias: 33, 21, 11, 7 UScale: 1.0 |
Mini Float with Alpha png (early experiments)
editA mini float format wedged into an 8 bit per channel RGBA png. Each 8 bit RGB channel has 6 Significand with the 2 LS exponent bits, the remaining exponent bits are in what is normally the alpha channel.
In the 8 repurposed alpha bits, the MSb is a 1 bit alpha, next is a signed/unsigned mode flag, then the 2 MSbs of each RGB channel exponent/sign bit.
Asymmetrical bias with a per-pixel control of signed/unsigned mode, default bias weighted to favor positive numbers.
4 bit exponent in unsigned mode, and 3 bit exponent in signed mode. The mode flag in the alpha sets signed/unsigned for the pixel, applying to all three RGB channels. In signed mode, each individual RGB channel can be either positive or negative in the range ±1.984375
The top MSb of the exponent is either a 4th exponent bit for positive floats, or is the sign bit.
- Apply a bitwise OR between the flag and the MSb (flag|MSb) which will always show sign for the number, 1==(+) 0==(-), regardless of mode.
Bit segmenting is the two MSb of the exponent, the full mantissa is in position on each RGB channel.
Significand (Mantissa) is 7 bits (6 bits explicit, 1 implied).
Bias and base can be arbitrary, set in the MFLT chunk.
- Default bias of 8 and base 2, provides a range of -1.98 to +508.0
- Signed mode range is ± 1.984375
- Unsigned mode is 0 to 508.0
- In signed mode, the top MSb is the sign bit.
- In unsigned mode, the top MSb it given to the exponent & indicates the exponent's sign.
- Signed or unsigned mode is per pixel, and can be dynamically switched.
- caveat: values less than zero can not be in the same pixel with values greater than 1.98
- This only applies to dynamic signed/unsigned mode.
- Encoder can resolve edge-case conflicts by clamping negative to 0 or overs to 1.98
- The MFLT chunk should have an image-wide lock for the sign/unsign flag.
An arbitrary base can be used
- The base can be 10 for instance
- For more granularity, the base "could" be something like square root of 2 (1.414...)
- Though it might be more efficient to introduce a scale factor in the MFLT chunk
- The one bit used as alpha might be better used to dynamically select/enable a scale factor.
Considerations
There perhaps should be separate biases in the MFLT chunk, one for signed and one for unsigned, though this assumes an image may have a combination of signed and unsigned mini-float pixels, which may or may not be advisable.
It also could be useful (or might be necessary) to have a separate base for signed and unsigned.
For the purpose, it may be useful to support moving a bit from exponent to the mantissa, so the mantissa is 7+1 implied. Identified in the MFLT chunk.
The one alpha bit perhaps should be referred to as a utility bit, and can be assigned in the MFLT chunk to act as one of: a) Alpha b) Per Pixel Scale c) Per Pixel Bias d) Per Pixel Base e) Per Pixel bit structure (6 bit or 7 bit mantissa)
Which bits go to the alpha, there are arguments for MSb exponent, LSb exponent, or LSb mantissa.
Summary
- Effective precision of an 11 bit float (4bit exponent, 7bit mantissa)
- Maps to an 8 bit per channel png (RGBA) container
- Expected to compress well using the standard png compression schemes.
- Arbitrary base supported (image wide)
- Scale factor supported (image wide)
- Adjustable bias (image wide)
- Precision is achieved by:
- Asymmetric bias to maximize useful range for images.
- Dynamic per pixel sign/unsign mode assumes that:
- negative RGB data is less common, and
- when present in a pixel, the other pixels are likely to be in the ±1.98 range,
- encoder can resolve edge case conflicts by clamping negatives to 0 if a high value is present or vice versa, with minimal issues.
Mini Float png (Proposed) | ||||||||||||||||||||||||||||||||||
Optimized for RGB Image Data 11 bit effective precision with asymetrical bias |
||||||||||||||||||||||||||||||||||
R exp LSb |
R 6 bit significand | G exp LSb |
G 6 bit significand | B exp LSb |
B 6 bit significand | Alpha Bit | Sign/Unsign Mode Flag | Red Sign or Expnt MSb | Red Exponent MSb | Grn Sign or Expnt MSb | Grn Exponent MSb | Blue Sign or Expnt MSb | Blue Exponent MSb | |||||||||||||||||||||
┌─┐ | ┌──────────┐ | ┌─┐ | ┌──────────┐ | ┌─┐ | ┌──────────┐ | ┃ | ┃ | ┃ | ┃ | ┃ | ┃ | ┃ | ┃ | |||||||||||||||||||||
1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | |||
31 | 30 | 29 | 24 | 23 | 22 | 21 | 16 | 15 | 14 | 13 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |||||||||||||||
Mode B Unsigned Float 3 bit exponent, 7 bit mantissa + 1 bit implied, 2 bit bias select | ||||||||||||||||||||||||||||||||||
R exp |
R 7 bit significand | G exp |
B 7 bit significand | B exp |
B 7 bit significand | A | R exp MSb |
G exp MSb |
B exp MSb | |||||||||||||||||||||||||
LSb | ┌────────────┐ | LSb | ┌────────────┐ | LSb | ┌────────────┐ | ┌─┐ | ┌─┐ | ┌─┐ | ┌─┐ | |||||||||||||||||||||||||
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | |||
31 | 30 | 29 | 24 | 23 | 22 | 21 | 16 | 15 | 14 | 13 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |||||||||||||||
Chunks: | IHDR | sBIT | MFLT MFLT | |||||||||||||||||||||||||||||||
Values: | Bit Depth: 8 Color Type: 6 |
R: 8, G: 8, B: 8, A: 1 | MODE A R2x6 G2x6 B2x6 A1 F1 R2x G2x B2x |
Signed SBase: 2.0 SBias: 7 SScale: 1.0 Unsigned Base:1.41421356 Bias: 10 Scale: 1.0 Sign/Unsign Mode Lock: 0 | ||||||||||||||||||||||||||||||
©2023 Myndex Research | R: 8, G: 8, B: 8, A: 2 | MODE B R1x7 G1x7 B1x7 A2t R2x G2x B2x |
Unsigned UBase:2.0 UBias: 7 UScale: 1.0 Sign/Unsign Mode Lock: 1 | |||||||||||||||||||||||||||||||
11 bit effective precision per a 3+1 bit exponent, 6+1 bit significand | Signed Float: 1b sign, 3b exponent, 7b significand (6b + 1b implied) Unsigned Float: 4b exponent, 7b significand (6b + 1b implied) | ||||||||||||||||||||||||
half float (EXR)
editIEEE half-precision 16-bit float | ||||||||||||||||
sign | exponent (5 bit) | fraction (10 bit) | ||||||||||||||
┃ | ┌────────┐ | ┌───────────────────────────┐ | ||||||||||||||
0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
15 | 14 | 10 | 9 | 0 | ||||||||||||
LaTeX Scratchpad
edit[Help for LaTeX math] on Wikipedia
APCA
editAccessible Perceptual Contrast Algorithm
The Basic Math for APCA Contrast Reverse Notation (SAPC 0.98G-4g):
edit
|
The Basic Math APCA Contrast, Standard Notation (SAPC-8 0.98G-4g):
edit
|
Copyright © 2019-2023 by Andrew Somers. All Rights Reserved.
For more about this, see my GitHub repository: GitHub.com/Myndex/SAPC-APCA
sRGB to Y — Simple Exponent Method
edit
Calculating Visual Angle
edit
Simple Formula for Phi / Golden Ratio
editThe Somers Golden Simplification
The formula for phi can be reduced to a positive exponent, multiplication, and addition:
Why this is interesting:
editPhi approximates the Fibonacci ratio, starting with the 5th Fibonacci number pair. It is interesting that 5, or power of 0.5 or factor of 0.5 etc is throughout. Also, the version
phi=5**0.5*0.5+0.5;
it is more than twice as fast as others. But of course, it's a constant, so speed is irrelevant.
POLL
editWhich of the following equations for phi is easier to do in your head? Or at least, easier to remember?
And continuing my obsession with light color and perception:
Articles And Ancillaries Ala Andrew
editNEW SCIENCEY STUFF! COLOR, LIGHT, and CONTRAST
editThe Lighter Side of Light An irreverent look at light, vision, and color, and the many very similar sounding terms relating to colorimetry, light, color, along with a bit of history and some generally snarky satire.- Temporarily removed, as apparently trolling Karen's have no sense of humor.
Contrast and Color in Content Design for Web and Filmmaking
editFEATURED: The Realities And Myths Of Contrast And Color Comprehensive color vision over view, emphasis on contrast for reading.
edit- Busy Background Breaks Bulletin Examples of how to destroy readability by choosing the wrong image as a background. And also, how
- Hats off to ALL CAPS Another in our series, myth-busting accessibility misunderstandings: are dyslexia fonts useful, and the...
- COLORSPACES - The Primal Frontier A Brief Look at Math Models for How We See
- Where's The Luv? A discussion of the CIELUV color space, and where it's useful: creating gradients, perceptually uniform color ....
- Will Work For Color Part two of CIELUV, discussing more about working spaces.
- Gradients in Space! A discussion of gradient techniques.
- Lstar WARS Episode IV - A New Color Further discussion of gradients and color mixing form computer displays.
Additional Vision Research, etc.
edit- The Color Vision Deficiency Simulator This is a simulator of "color blind" vision, including the very rare blue cone monochromacy.
- Luminance Contrast and Perception Classic article on luminance contrast, with lots of math and code samples, written before the invention of APCA
- The Visual Contrast Wiki at W3.org DEPRECATED A compendium of notes related to my contrast and perception research project.
Articles pointing out how WCAG 2.x contrast specs are obsolete, wrong, harmful, or broken.
edit- Better reading on the web You may have heard that a recent survey of the top one million websites found substantial usability problems, such as poor color contrast for text. And In truth there is a problem, but not...
- Please Stop Using Grey Text For over 1000 years black text on white paper has been the best practice for printed texts worldwide. Since the advent of the web and WCAG 2 contrast specs, we’ve seen websites
- What’s Red & Black & Not Read All Over?Do the WCAG 2 contrast guidelines help color vision deficiencies? We look into the user needs of various color insensitive types and the answer may surprise you.
- A Contrast of ErrorsThe WCAG 2 contrast guidelines have been around for fourteen years—that’s about 106 in “dog years”. The march of tech...
Comparing APCA for WCAG 3 to the old WCAG 2.x Contrast Method
edit- Orange You Wondering About Contrast? An examination of the new WCAG_3 candidate contrast method vs the older WCAG 2.x method.
- The Lighter Side of Dark Backgrounds Part two of examining the new APCA contrast method.
- WCAG 2 vs APCA Contrast Shootout Part three of examining the new APCA contrast method.
GENERAL IT and WEB RELATED
edit- Redirects for SEO The importance of redirects in search engine rankings.
- Evaluating Fonts for Accessibility This PDF report evaluates dozens of fonts for accessibility, readability, and what to look...
- Modern Password Theory in a Nutshell — a practical look at online security for our modern age.
SNARKY McSNARKMAN: AngryAndrew's Op-Ed
edit- What Remains of a Country for this Old Man? There is no country for old men, amidst the tiresome slumber of ignorance-claiming-honor....
- Small Text is Medium’s Large Fail For a platform that is entirely based around readable content, one would think that it’d be close to State of the Art, instead of the State of Unreadable.
- The Laws of Technodynamics A Restatement of Thermodynamics in the Context of Applied Problem Solving Through Technology.
- ENDING POLARIZED POLITICS Two parties, many problems — and a solution with a better model for elections.
- Climate Deniers Left & Right There are two kinds of climate deniers. Those that deny there is a problem, and those that deny the best way to fix it.
- What’s Wrong With This Picture? An Examination of the Causes of Income Disparity. Is it rich CEOs? Or something more sinister?
- Election Fraud & Other Illusions How conspiracy theory websites gave rise to a widely spread disinformation campaign apparently aimed at voter suppression.
- A Brief History of Walls, Ignorance, and Greed Trump’s Test Walls Are Easily Breeched, and Other Foibles
- The List of Metal Rules There Are More Rules than the "Golden" Rule to Consider. Here the list is Iron, Bronze, Silver, Golden, Platinum, Plutonium, with each in turn adding to the other
- Sidewalk in the Sky My personal bio-clump-of-blah-blog, aka my Descriptive Textural Info-Data-thingy that Supposedly Defines Me as a Person. Also Known as a “Profile.”
- The Book of AngryAndrew A New New Testament of the Bible, which is also known as "Worshiping Louis Cypher for Phun and Prophet."
- AngryAndrew’s New Year’s Resolution AngryAndrew Discusses New Year’s Day, Resolutions, Solstices, Ancient Civilizations, and… Fluffy Bunnies?
FILMMAKING and POST PRODUCTION
edit- Angelisqatsi: Life Out Of Body • a short film which is really a glorified aerial cinematography demo reel.
- VFX & Title Design Demo Reel • a minute or two of some of the titles and visual effects that I created for various Hollywood films.
- Archive of legacy film industry articles, from the era of the transition from chemical imaging to digital imaging.
zzzzEnd Pad (Yea it's a clue as to how old I am. Also, "acoustical coupler at 300 baud").