Recent

Author Topic: Pixel Pitch Function (mm global units, round down to closest integer pixel)  (Read 6935 times)

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2099
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Pixel Pitch Function (mm global units, round down to closest integer pixel)
« Reply #90 on: November 10, 2022, 10:12:08 pm »
Attached full project, hope it helps you a little on your journey  O:-)

Works great! Many thanks. Not really fan of the word "dot", so might change it to "pixel" for the pitch.
You are welcome, for yourself you can name things however you like but in real life a dot is a dot and a pixel is a pixel, they are not related just that a pixel is made out of dot(s).  :-[
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Pixel Pitch Function (mm global units, round down to closest integer pixel)
« Reply #91 on: November 11, 2022, 09:02:45 am »
Yet another update- I noticed the list of companies is not complete for some reason. So in case full company name is not returned- a short code is returned. Also added a faster full name finder.
Where did the company information come from?
Is this via an enumeration of registry data, or from some independent source?

Emptyself

  • New Member
  • *
  • Posts: 39
Re: Pixel Pitch Function (mm global units, round down to closest integer pixel)
« Reply #92 on: November 11, 2022, 09:44:38 am »

You are welcome, for yourself you can name things however you like but in real life a dot is a dot and a pixel is a pixel, they are not related just that a pixel is made out of dot(s).  :-[

Yes, I am aware of that. Pixel has a picture\image resolution meaning → the square (rect.) building block of single colour, but also a hardware meaning → the smallest, tiniest block of red|green|blue diodes… at least in modern day LCD\OLED monitors.

I think «dot» should be only for printing, «pixel» just for digital images and «fixel» for the hardware, because they are fixed and cannot be changed (unless you buy another monitor with dif. density of… fixels), whilst «dot» and «pixel» can be changed respectively from the printer settings and resizing the image digitally.

For example: an image of 100×100 pixels might take 320×320 fixels on the screen if intended to be seen on that current screen at 1:1 scale → 1 pixel will get represented by 32² pixels… I mean 32² fixels because that current monitor reports 32f/cm (or ≈3f/mm) then obviously the image will be 3.2×3.2 cm on the screen (no zooming), yet at the same time this same image if printed so its printed size to take up 10×10 cm the printer could be setup for 300dots/cm, thus the whole final printed size image will be of 3000×3000 dots resolution, yet still might look "patched" of squares (the individual pixels of the initial image)… the bigger it gets printed.

Fixel could (and should) have saved so much frustration… at least among general users.

I am naming it Fixel… it is about time to do so, though should have been done by the late '90s already.
« Last Edit: November 11, 2022, 11:14:05 am by Emptyself »

domasz

  • Sr. Member
  • ****
  • Posts: 437
Re: Pixel Pitch Function (mm global units, round down to closest integer pixel)
« Reply #93 on: November 11, 2022, 10:09:05 am »
Where did the company information come from?
Is this via an enumeration of registry data, or from some independent source?
https://uefi.org/pnp_id_list
Seems these are the guys that register all the 3-letter company names so the list *should* be complete. But I tried on my AOC monitor and AOC was not on the list so I added it to my list.
« Last Edit: November 11, 2022, 10:14:43 am by domasz »

Emptyself

  • New Member
  • *
  • Posts: 39
Re: Pixel Pitch Function (mm global units, round down to closest integer pixel)
« Reply #94 on: November 11, 2022, 11:06:51 am »
There… pure bliss!  ;)
Had to modify some calc, but seems it works!
Much, much better!  8-)
« Last Edit: November 11, 2022, 11:16:33 am by Emptyself »

domasz

  • Sr. Member
  • ****
  • Posts: 437
Re: Pixel Pitch Function (mm global units, round down to closest integer pixel)
« Reply #95 on: November 11, 2022, 11:29:18 am »
Just 2 things to be aware of:
1) Works only under Windows. Won't work on MacOS nor Linux. Should work on anything from Windows XP up. Compiles nicely with Lazarus and Delphi 7.
2) Will return wrong values for monitors with resolutions higher than 4096x4096. This perhaps can be fixed but I don't have access to such a monitor

alpine

  • Hero Member
  • *****
  • Posts: 1069
Re: Pixel Pitch Function (mm global units, round down to closest integer pixel)
« Reply #96 on: November 11, 2022, 01:35:31 pm »
Just 2 things to be aware of:
1) Works only under Windows. Won't work on MacOS nor Linux. Should work on anything from Windows XP up. Compiles nicely with Lazarus and Delphi 7.
2) Will return wrong values for monitors with resolutions higher than 4096x4096. This perhaps can be fixed but I don't have access to such a monitor
On my virtualized Win7 (VirtualBox 6.1) the info returned is all zeros.
Not to mention that the display may go through additional scaling. This is true not only for VirtualBox but also for any remote access application - AnyDesk, TeamViewer, etc.

On my Win10 notebook (ASUS UX303L) the info is:
Code: Text  [Select][+][-]
  1. Monitor: #0
  2. Resolution: 3200 x 1800 fx
  3. Size: 29.30 x 16.50 cm
  4. Diag: 33.63 cm
  5. fx/cm: 109.19
  6. Fixel Pitch: 0.09 mm
  7. Aspect Ratio: 16:9 (1.78:1)
  8. Year: 2014
  9. Manufacturer: SDC
  10. PNP: SDC364A
  11. -----------
It has a resolution (pitch 0.09mm) too big for it's physical dimensions (13.2"), and it is almost unusable with Windows in full resolution. Because of that, I've changed it to 1600x900 (1/4). Now every pixel is a square of 4 pixels. The "Fixel" pitch must be doubled. The point is that the display resolution might have been changed with something other, even the new aspect ratio might be different.

My working machine has 2 monitors with equal resolution but different physical dimensions. What if you put your "Fixel" calibrated drawing to be one-half visible on the left monitor and the other half on the right one?

"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

Emptyself

  • New Member
  • *
  • Posts: 39
Re: Pixel Pitch Function (mm global units, round down to closest integer pixel)
« Reply #97 on: November 11, 2022, 03:04:42 pm »
It has a resolution (pitch 0.09mm) too big for it's physical dimensions (13.2").

My working machine has 2 monitors with equal resolution but different physical dimensions. What if you put your "Fixel" calibrated drawing to be one-half visible on the left monitor and the other half on the right one?

I do not know how the code works. It is not my code. FixelPitch of 0.09mm (≈ ⅟₁₀ mm ) is quite tiny… this is in the realm of 4K (for 13" diagonal, 16:9 AR ≈ 1.7778), that is 3197 fixels width, OK technically it is 3K.

Code: Pascal  [Select][+][-]
  1. Screen size     Resolution      Aspect ratio    Pixel density   Pixel pitch
  2. 11.6" wide      1920 × 1080 pixels     16:9    Approx. 190 ppi Approx. 0.13 mm
  3. 13.3" wide      1920 × 1080 pixels     16:9    Approx. 227 ppi Approx. 0.11 mm
  4. 12" wide        2160 × 1440 pixels     3:2     Approx. 216 ppi Approx. 0.12 mm
  5. 13.3" wide      2560 × 1440 pixels     16:9    Approx. 221 ppi Approx. 0.12 mm
  6. 13.3" wide      2560 × 1600 pixels     16:10   Approx. 227 ppi Approx. 0.11 mm
  7. 14" wide        3200 × 1800 pixels     16:9    Approx. 256 ppi Approx. 0.1 mm
  8. 15.4" wide      2880 × 1880 pixels     16:10   Approx. 223 ppi Approx. 0.12 mm
  9. 15.6" UHD 4K    3840 × 2160 pixels     16:9    Approx. 282 ppi Approx. 0.09 mm



I really believed that manufacturers of displays would provide the FixelPitch physical dimensions of their display monitors. the same way they provide the resolution, 'size' (diagonal… quite meaningless if you ask me) und  aspect ratio (prop. coefficient).

Of course one of the confusion eliminated is to agree on using [mm] units of measurements instead. Not mixing inch and mm.

the 'approx.' values should be Fixeled to an exact value for the self–monitor (current).
For example if the FixelPitch is 'approx.' 0.23mm then 1920 fixels would = 441.6mm physical width for the screen.
Let's say we measure it (width for the screen)  and it is 'approx.' 452mm.
Since we can not change the count of Fixels (1920) then we will round the 'approx.' to closer integer values in mm.

452 / 1920 = 0.235mm fixel pitch
0.235*1920 = 451.2 (≈452) ±1mm for such measurement is an acceptable error: "thermal expansion" etc.

Ok, let it be 451… 451/1920 = 0.2348mm
no big deal

no one will get hurt making a correction to the fixel pitch as long as it is at the third decimal place (x * ⅟₁₀₀₀ of mm, where x is a single digit > 0)
or as long as it is at the closest integer value for the width of a monitor (resp. the height) in mm.

here is an article:
Understanding pixel density in the age of 4K
« Last Edit: November 11, 2022, 03:34:51 pm by Emptyself »

 

TinyPortal © 2005-2018