Sunday, August 17, 2014

Exponential growth and Ebola

While the subject is grim Ebola infections show clearly how exponential growth works. Once you see it it is easy to predict what will happen and what should be done.

This data is from Wikipedia:
2014 West Africa Ebola virus outbreak


 Here's the growth curve you normally see in media. The growth is clearly exponential and the end of curve, the current situation always shows like it's skyrocketing. (Well, it is.) The situation in Guinea and Sierra Leone show linear growth which is better. Liberia is quickly catching up Sierra Leone.

But what happens when you switch to logarithmic scale?

From logarithmic scale you see the growth rate is straight line from 18.6 to 13.8. That is because the growth rate of ebola is exponential. The daily growth rate from 18.6 till 13.8 is 2,5% meaning ebola infections increase threefold in one month.It also means that every day the western countries wait in giving help means the next day 2,5% more help is needed.

Sunday, August 10, 2014

Current HDTV Gamut Rec.709 vs. 4K Gamut Rec.2020:What are we missing?

At first, here is a great article about color gamuts:
TFT Central: The Pointer's Gamut

The color management systems are great but they are so automatic that if I have a picture that was created with larger gamut than my monitor has, it's nearly impossible to actually see what are the colors that my monitor is missing. The 'relative intent' is the best of rendering intents to see that and even with it you only see problems if the colors are way way off.

In photo editing software there is a feature called 'gamut warning' that shows out-of-gamut colors as a special color. Problem of course is photo editing software is an expensive way to experiment. They are not cheap. The simplest way would be if there is a rendering intent made for that special purpose but there isn't.

Now when with 4K HDTV standards we are finally getting a larger gamut Rec.2020, what are we missing in current Rec.709? It is impossible to test that with videos because they are already filmed in Rec.709 or smaller gamut. Only way to find that out is seek for photos taken, edited and released in bigger gamuts like AdobeRGB or ProPhotoRGB.

The problem with current Rec.709 ( and sRGB ) gamut in photos is the gamut has already been shrank smaller. It isn't possible to make it wide again. Depending on how the film is edited, the gamut may have been shrank with 'relative intent' when out-of-gamut colors look 'burned' or with 'perceptual intent' or others like 'perceptual intent' when shrinking the gamut also affects colors that were already inside gamut.

That may be the problem when I'm calibrating my displays. Even when I calibrate the white point and primaries correct, that doesn't make the colors right because they might have been undersaturated already in postprocessing of the movie. That is why the colors that are closest to white point D65 also look the best (IMHO).

You could oversaturate your calibration to compensate but the problem of course is there is no common agreement or standard how the undersaturation might have been done in postprocessing so you would be guessing.

But we can of course try to understand what we are missing. There is a program jpegicc.exe that is in Cygwin's lcms-package. Lcms(Little Color Management System) is a library that supports Gamut Warning and jpegicc.exe is a utility that uses that library. (Go install it ), LittleCMS uses gray color for gamut warning.

Then you can create run.bat that contains:
"C:\cygwin\bin\jpegicc.exe" -v -p "C:\Windows\System32\spool\drivers\color\sRGB Color Space Profile.icm" -g -t 1 -m 1 %1 %1.sRGB.jpg
This batch file then takes nmae of the picture file as parameter and creates another picture file with a ".sRGB.jpg" added in the end of file name.

If you are already using Linux I'm quite sure you can figure out how to run this in it. Little CMS web site contains sRGB profiles if you cannot find them in your system. 

Here are some example pictures I found that have larger gamuts and actually use them. Al these pictures have gamut warnings somewhere. Because I don't own the rights for these pictures, I only link them here. I have no knowledge how much these pictures where altered from original ones either.

Buildings etc. 

http://blog.james-pratt.com/wp-content/uploads/2014/03/2005-0903-0184.jpg

https://secure.flickr.com/photos/wili/295189351/

http://www.lux-et-color.ru/wordpress/wp-content/uploads/stream/33/IMG_0107.jpg
http://www.lux-et-color.ru/wordpress/wp-content/uploads/stream/25/IMG_6948.jpg
http://www.lux-et-color.ru/wordpress/wp-content/uploads/stream/25/IMG_9693.jpg

http://blog.dominik.ca/wp-content/gallery/25mm_sample_1/graffiti_wall.jpg

Nature

http://album.foto.ru/photos/or/114625/3319242.jpg
http://meyeryu.files.wordpress.com/2011/01/prgb_img_5871.jpg
http://rlcaronblog.com/wp-content/uploads/2012/12/RLC0291.jpghttp://desudesign.com/wp-content/uploads/2012/03/Simple_8774-Edit-AdobeRGB.jpg
http://stevemccurry.files.wordpress.com/2014/07/spain-10051-1.jpg
http://www.lux-et-color.ru/wordpress/wp-content/uploads/stream/25/_MG_9902.jpg

People

http://fourthirds-user.com/images/204/E-P1-fromRAW-AdobeRGB.jpg
http://fashionwordl.files.wordpress.com/2012/02/mg_9438-300dpi-30cm-alto-adobe-rgb-baja.jpg
http://fashionwordl.files.wordpress.com/2012/02/mg_9929-300dpi-30cm-alto-adobe-rgb-baja.jpg
http://meyeryu.files.wordpress.com/2011/01/prgb_mg_8193.jpg
http://jamiedentontandp2b.files.wordpress.com/2012/02/pro-rgb.jpg

WARNING:Nudity
http://tricjastyling.com/wp-content/uploads/2014/02/IC_LottePOTY_04_AdobeRGB1998.jpg
http://tricjastyling.com/wp-content/uploads/2014/02/IC_LottePOTY_05_AdobeRGB1998.jpg
http://tricjastyling.com/wp-content/uploads/2014/02/IC_LottePOTY_08_AdobeRGB1998.jpg

Monday, August 4, 2014

Simple 3d crosstalk measurement charts

I recently bought a new television capable of passive 3d. When I was trying to select the "best" television I found out there wasn't a proper easy way to measure 3d crosstalk that is the most important feature of 3d technology. It's equally important as stereo crosstalk in audio signals but nowadays most audio signals are so high fidelity that audio crosstalk is basically non-existent.

But 3d technology still has to evolve, still too much crosstalk and to push the technology forward the consumers have to know which technology to buy and which not. One way of doing that is figuring how to measure 3d crosstalk preferable without any meters but visually and doing it so that results are interchangeable between different televisions settings and 3d technologies.

One of important settings will be gamma curve. Some televisions have gamma curve 2.2, some 2.4, others something else. The gamma curve defines how the television shows signals color levels as luminance levels in screen. If gamma curve is 1.0, zero signal shows zero light, 1 signal shows full light and 1/2 signal shows half light. But normal gamma curves used (2.2, 2.3, 2.4 ) means that 1/2 signal is not shown as half light but less than that.


If you don't know what gamma curve your television is set to, it probably is 2.2.

With 3d glasses, left eye sees only picture intended for left eye and vice versa. But technology is not perfect and left eye sees also a little bit of picture intended for the right eye. That is 3d crosstalk and in movies it shows as ghost images.

Static contrast ratio is the ratio between the whitest white and blackest black in static picture. If you have OLED television, then it's contrast ratio is virtually infinite. Others have to live with little imperfection and for instance my televisions static contrast ratio should be about 1:3000.  The 3d crosstalk can also be presented as a ratio between the "right" picture and the "wrong" picture.

How test patterns work

 

In my test patterns I have divided three main colors to separate test charts and both eyes have their own test charts so there are six different test charts. There is also test charts for white color but problem with white test chart is that your television might have for instance more crosstalk for instance blue color so you would have to try to match blue color with white color and it's difficult to do without a meter. It it easier to measure each color separately.

The test charts have the "right" picture that is different patches starting from black patch and moving to patches with more luminance. The "wrong" picture is full white stripes. When you are testing with left-eye-pictures, you put a piece of paper or your hand in front of your right eye to block it and and only your left eye sees the picture through the 3d glasses. Then you see the "right" picture as you should and the "wrong" picture as faint but you can still see the with stripes.


Selecting the right patch


Now you have to select which of the "right" pictures patches equals the "wrong" pictures faint white stripe in luminosity. The faint white stripe is the crosstalk and you are trying to measure it. If it is too difficult to find the correct patch, you can also try to find the first and last patch that look similar as the white patch. Then take the luminosity values from the table below and the right patch is the one that has luminosity (first patch luminosity + last patch luminosity )/2 eg. the average of the two.



Luminosity for patches:


Patch 2,2 2,3 2,4
0 0 0 0
1 5,07705190066176E-006 2,91714209990719E-006 1,67611405153091E-006
2 0,000023328 1,4365692796936E-005 8,84658300141058E-006
3 5,69217657121931E-005 3,65036650558521E-005 2,34096315502103E-005
4 0,0001071874 0,000070745 4,66925450146811E-005
5 0,000175124 0,0001181921 7,97685278983462E-005
6 0,0002615438 0,0001797651 0,0001235568
7 0,0003671363 0,0002562613 0,0001788706
8 0,0004925038 0,0003483891 0,0002464447
9 0,0006381828 0,0004567887 0,0003269532
10 0,0008046585 0,0005820464 0,0004210208
11 0,0009923743 0,0007247042 0,0005292319
12 0,0012017395 0,0008852674 0,0006521366
13 0,0014331346 0,0010642099 0,0007902557
14 0,0016869153 0,0012619788 0,0009440845
15 0,0019634162 0,0014789976 0,0011140959
16 0,0022629532 0,0017156692 0,0013007431
17 0,0025858256 0,0019723778 0,0015044612
18 0,0029323183 0,0022494914 0,0017256693
19 0,003302703 0,0025473632 0,0019647722
20 0,0036972396 0,0028663325 0,0022221612
21 0,0041161771 0,0032067268 0,0024982154
22 0,0045597549 0,003568862 0,0027933027
23 0,0050282035 0,0039530436 0,0031077808
24 0,0055217449 0,0043595678 0,0034419975
25 0,0060405937 0,0047887218 0,0037962918
26 0,0065849574 0,0052407843 0,0041709944
27 0,007155037 0,0057160266 0,0045664279
28 0,0077510274 0,0062147127 0,0049829077
29 0,0083731177 0,0067370998 0,0054207423
30 0,0090214919 0,0072834387 0,0058802336
31 0,0096963287 0,0078539744 0,0063616773
32 0,0103978023 0,008448946 0,0068653632
33 0,0111260824 0,0090685875 0,0073915756
34 0,0118813344 0,0097131276 0,0079405936
35 0,01266372 0,0103827904 0,0085126911
36 0,0134733969 0,0110777953 0,0091081373
37 0,0143105194 0,0117983575 0,0097271968
38 0,0151752382 0,0125446878 0,01037013
39 0,0160677009 0,0133169933 0,0110371927
40 0,0169880521 0,0141154772 0,011728637
41 0,0179364333 0,0149403391 0,0124447112
42 0,0189129834 0,0157917752 0,0131856597
43 0,0199178384 0,0166699782 0,0139517235
44 0,0209511319 0,0175751379 0,01474314
45 0,0220129949 0,0185074407 0,0155601436
46 0,0231035562 0,0194670703 0,0164029652
47 0,0242229421 0,0204542075 0,0172718328
48 0,0253712769 0,0214690304 0,0181669716
49 0,0265486828 0,0225117143 0,0190886036
50 0,02775528 0,0235824322 0,0200369483
51 0,0289911865 0,0246813545 0,0210122224
52 0,0302565189 0,0258086492 0,0220146402
53 0,0315513914 0,0269644822 0,0230444132
54 0,0328759169 0,028149017 0,0241017507
55 0,0342302066 0,0293624149 0,0251868596
56 0,0356143697 0,0306048353 0,0262999445
57 0,0370285142 0,0318764356 0,0274412077
58 0,0384727463 0,0331773711 0,0286108494
59 0,039947171 0,0345077952 0,0298090678
60 0,0414518916 0,0358678596 0,0310360589
61 0,0429870102 0,0372577141 0,0322920169
62 0,0445526273 0,0386775068 0,0335771338
63 0,0461488424 0,0401273841 0,0348916
64 0,0477757536 0,0416074907 0,036235604
65 0,0494334576 0,0431179699 0,0376093323
66 0,0511220501 0,0446589632 0,0390129699
67 0,0528416255 0,0462306108 0,0404467
68 0,0545922773 0,0478330511 0,0419107041
69 0,0563740976 0,0494664215 0,0434051623
70 0,0581871775 0,0511308576 0,0449302529
71 0,0600316071 0,0528264938 0,0464861526
72 0,0619074756 0,0545534633 0,0480730369
73 0,0638148709 0,0563118977 0,0496910795
74 0,0657538803 0,0581019275 0,0513404528
75 0,0677245897 0,059923682 0,0530213278
76 0,0697270844 0,0617772892 0,054733874
77 0,0717614488 0,0636628758 0,0564782599
78 0,0738277663 0,0655805676 0,0582546522
79 0,0759261195 0,0675304891 0,0600632165
80 0,07805659 0,0695127636 0,0619041174


Little theory about 3d crosstalk


When you are viewing picture for your left eye, the patch stripe consists of two pictures, the left eye patch and the black portion of the right side picture.The black is not completely black and it depends of televisions contrast ratio. In calculations we normalize the luminance that complete black is 0 and full white is 1. There is no complete black ( unless you have OLED) so in our calculations black is the contrast ratio CR. If my tv has CR 1:3000 then luminance of black will be 1/3000.

We'll call 3d crosstalk contrast as 3dCR.

The patch luminance of "right" picture will be ( CR + power(patch,gamma) *(1-CR)) because the patch number has to be transformed to linear values through gamma power function and then it has to fit between values CR and 1. The luminance of "wrong" picture will be black multilpied by 3dCR.
Then the luminance of the patch you selected is:
( CR + power(patch,gamma) *(1-CR)) + CR*3dCR

The white stripe ( the "wrong" picture ) consists of black of "right" picture and white of "wrong" picture multiplied by 3dCR.
Then the white stripe luminance is: CR + 1 * 3dCR

Because you selected the patch that equals the white stripe:
( CR + power(patch,gamma) *(1-CR)) + CR*3dCR = CR + 1 * 3dCR

I'll then solve 3dCR:
( CR + power(patch,gamma) *(1-CR)) + CR*3dCR = CR + 1 * 3dCR
CR + power(patch,gamma) *(1-CR) + CR*3dCR = CR + 1 * 3dCR
power(patch,gamma) *(1-CR) + CR*3dCR = 1 * 3dCR
power(patch,gamma) *(1-CR) = 1 * 3dCR  - CR*3dCR
power(patch,gamma) *(1-CR) = 3dCR * (1 - CR)
power(patch,gamma) = 3dCR
The equation seemed difficult at first but in the end only the patch luminance is needed for 3d contrast ratio!

I've precalculated 3d contrast ratio ( = 1/3dCR) values for different gamma values:

Patch 2,2 2,3 2,4
0 infinite infinite infinite
1 196 965 342 801 596 618
2 42 867 69 610 113 038
3 17 568 27 395 42 717
4 9 329 14 135 21 417
5 5 710 8 461 12 536
6 3 823 5 563 8 093
7 2 724 3 902 5 591
8 2 030 2 870 4 058
9 1 567 2 189 3 059
10 1 243 1 718 2 375
11 1 008 1 380 1 890
12 832 1 130 1 533
13 698 940 1 265
14 593 792 1 059
15 509 676 898
16 442 583 769
17 387 507 665
18 341 445 579
19 303 393 509
20 270 349 450
21 243 312 400
22 219 280 358
23 199 253 322
24 181 229 291
25 166 209 263
26 152 191 240
27 140 175 219
28 129 161 201
29 119 148 184
30 111 137 170
31 103 127 157
32 96 118 146
33 90 110 135
34 84 103 126
35 79 96 117
36 74 90 110
37 70 85 103
38 66 80 96
39 62 75 91
40 59 71 85
41 56 67 80
42 53 63 76
43 50 60 72
44 48 57 68
45 45 54 64
46 43 51 61
47 41 49 58
48 39 47 55
49 38 44 52
50 36 42 50
51 34 41 48
52 33 39 45
53 32 37 43
54 30 36 41
55 29 34 40
56 28 33 38
57 27 31 36
58 26 30 35
59 25 29 34
60 24 28 32
61 23 27 31
62 22 26 30
63 22 25 29
64 21 24 28
65 20 23 27
66 20 22 26
67 19 22 25
68 18 21 24
69 18 20 23
70 17 20 22
71 17 19 22
72 16 18 21
73 16 18 20
74 15 17 19
75 15 17 19
76 14 16 18
77 14 16 18
78 14 15 17
79 13 15 17
80 13 14 16

So if I have selected patch number 37 for blue color and my gamma is 2.4, the 3d contrast ratio for blue is 1:103 which means less that 1% of blue crosstalk. The table also shows why knowing your gamma setting is important. 

You can calculate your white 3d contrast with this formula:

The white contrast =  (
( Red contrast * 0,212655 ) +
( Green contrast *
0,715158 ) +
( Blue contrast * 0,072187 )
)
The white contrast =  (
( Red contrast * 0,212655 ) +
( Green contrast * 0,715158 ) +
( Blue contrast * 0,072187 )
)

The test pictures with 60 patches:







 And the white ones just for curiosity:


And the additional test pictures with 80 patches:








Friday, July 18, 2014

MoveWindows: Restoring all windows to primary display

This is just a quick hack. There is some kind of bug in AMD drivers or maybe in Win7. When my LG 34UM95-P goes to standby, some of my windows go off-screen on the right side of my display.

I can recover some of my windows back with Move-command but in the long run it is easier just to write program that does the same. First I tried to do this with Powershell but with it seems to be easier to do with Python because it's easy to get right modules.

The script ( and program)  restores all windows that are outside the primary display back to display. I haven't tested it yet with multiple displays and I'm quite sure it doesn't work. I only need this right now for one display.

If script is run without parameters, it only executes once. If it run with a parameter, the script loops indefinitely and the parameter is the delay between loops in seconds.


The source code for my scripts is in GitHub
https://github.com/MarkoMarjamaa/MoveWindows

Executable:
https://github.com/MarkoMarjamaa/MoveWindows/releases/download/v1.0/MoveWindows.exe

Tuesday, July 15, 2014

Semi-dynamic Templates for Putty

One of the missing features of Putty is templates.
I've been doing some work outside and in sunlight the usual terminal colors, black background and white letters just don't work. So I had to change the settings for a couple of my sessions.

I'd been wondering a while about templates in Putty so I wrote a simple script that allows to keep your own common settings in Templates registry key. Putty has it's setting in HKCU:\Software\SimonTatham\PuTTY and all the session settings are in Sessions-key.

This script searches for all Sessions and if it finds property TemplateName it applies templates found in that property from key HKCU:\Software\SimonTatham\PuTTY\Templates. TemplateName can have more than one template name, the template names are comma-separated and applied in that order listed.

Templates can have parent templates. It as also possible to create subkeys in Templates key if you want to create your own set of templates and import that key to another computers without messing templates in there. Then the tempalate name would be like Marko/Summer.

If you import templates from others keep in mind there is no security. Everything that is in that template overwrites those properties in your session. So you should always know what settings these templates change.

When you want to apply the templates to sessions, you simply run script ApplyPuttyTemplates.ps1. The script copies all the properties found in templates over the sessions properties. (=Take a backup before you start playing with this )

There are example templates in file PuttyTemplates.reg.
Root-template has the settings you want to your every session.
Winter and Summer - templates change the screen colors and have Root template as a parent template.
Then there is a separate Season - template that has Winter or Summer as a parent template so you can quickly change Winter/Summer all the sessions that use Season template.

You can also create templates like Production, Testing that have different fonts or colors and apply those those templates after the Season template is applied (for instance  TemplateName=Season,ServerType/Production ).


It's not perfect, it's not polished. It's working and I can quickly apply new templates to my sessions.


The source code for my scripts is in GitHub
https://github.com/MarkoMarjamaa/PuttyTemplates

Sunday, June 15, 2014

LG 34UM95-P review :Would be great without the Super Energy Saving bug: Part 2


Calibrating with DispcalGui


I wrote a separate post about calibrating with dynamic contrast because it isn't specific to this monitor:
Calibrating with ArgyllCMS&DispCalGUI with dynamic contrast or projector iris. 

I calibrated the monitor yesterday but only with 88 patches just to check the calibrating works. Today I'm going to do the real >1000 patch calibration.

Auto Standby bug(?)


After I'd been using the monitor for 4 hours, it popped up message saying monitor hasn't been used for 4 hours and it's going to be shut down in 5 minutes. What? I've been using the monitor the whole time! And after 4 minutes another message came stating press any key or monitor is shut down in a minute. And it did shut down the monitor.

There is a setting in Menu/Settings/Auto Standby that was set to 4 hours. But in the manual it clearly says: Feature that automatically turns off the monitor when there is no movement on the screen for a period of time. Clearly it was not working at all. I don't know how it decides is there movement or not.

USB3 and Serial port used for communicating

 


There is an USB to Serial converter TUSB3410 inside the monitor. I have it now disabled because the ASMedia USB3 drivers were messing with my motherboards USB3 (=ASMedia). But True Color Finder seems to calibrate through this port. I would have though it was using DDC/CI but now because TUSB3410 is not working it True Color Finder says cannot connect. It should be easy to crack, there can't be that many commands. Just put a com port sniffer in between.

Cleartype Sub-pixel rendering 

 

I tested first with Lagoms sub-pixel rendering test and then with Windows own that sub-pixel ordering is RGB. It's better to test first with Lagom because Windows only supports RGB and BGR sub-pixel orders. 

Conclusions (for today). 


I was wondering haven't any other reviewers noticed there isn't any dynamic contrast at all, or Super Energy Saving=Off actually shuts down the backlighting completely or the monitor turns off in 4 hours ( it was the default setting) no matter what you do? Or did I just get a faulty monitor?


LG 34UM95-P review :Would be great without the Super Energy Saving bug : Part 1

Calibrating with ArgyllCMS&DispCalGUI with dynamic contrast or projector iris.

When I was trying to calibrate LG's 34UM95-P, only way to calibrate was to use it's energy saving setting (=kind of slow dynamic contrast) on. The problem was it was slow. When I was measuring with HCFR I found out it needs at least 400ms delay before the luminance settles. In HCFR you can set this delay ( Latency Time) but not in ArgyllCMS&DispcalGui.

There is a commandline option in ArgyllCMS that allows you to run your own command every time the color is changed. It's main purpose is you can have your own way of showing the colors on screen. You can easily insert there also some delay.

Create file SensorDelay.bat and put it in your root ( the easiest way, it doesn't work well with spaces in path names. ).  In this batch file put complete path name and file name of sleep command you are going to use with parameters. I don't remember if Windows has any sleep command but I have several. Cyrwin has sleep with accuracy on seconds but Windows Resource Toolkit sleep you can set the delay to milliseconds so I used that one. I copied also the sleep command to root.

So my SensorDelay.bat is:
d:\sleep -m 500

The command parameter in ArgyllCMS is
-C "D:\SensorDelay.bat"

In DispCalGui you can set it in Options/Set additional commandline arguments
You only need to add the parameter to commands dispcal and dispread.

There you go! Now there is an additional 500 ms delay before each measurement.