Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pixel-Depth Scaling Incorrect

See original GitHub issue

I believe the calculation for the pixel-depth of the Camera sensor to be incorrect. Please see the below two images:


As you can see, the image on the left is using the default near_far=(0.01, 1000) during Camera initialisation. However this image is completely useless for vehicle navigation because all objects close to the car for a significant distance, such as bushes, have a lightness value of 0. So, I have reduced the Camera on the right’s near_far=(0.01, 100), expecting that objects at a distance of 100 to have a lightness value of 255 and objects at 0.01 to have a lightness value of 0. This should result in objects closer to the vehicle having a much more fine and resolved lightness scale. As you can see this is not the case.

The lightness values are not scaling whatsoever with the near_far setting of the camera. The image on the right shows that all objects within range of the cameras near_far clipping range, have the exact same lightness values as the image on the left. The only difference is the sky appearing darker because it is clipped at a shorter distance. I am almost certain this is not correct behaviour?


I believe the above code located in the Camera class in the decode_response method is maybe the culprit.

If indeed this is normal behaviour, how can I go about making objects closer to the vehicle have a finer resolution of depth? Because these depth images are completely useless to me.


To reproduce this behaviour, simply attach a Camera to a vehicle and adjust the near_far setting:



If the lightness values are scaled correctly, i would expect the sky to always remain white (lightness 255).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

BleedObsidiancommented, Mar 7, 2021

@pascale-commits Thanks for the guidelines. I’ve submitted a new pull request and also agreed to the CLA (sent an email to

mihalykorodicommented, Feb 13, 2021

Hi! I have the same problem. This should fix it #105

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inaccurate Screen Resolution When Scale Is Over 100% #285
Describe the bug incorrect screen resolution being returned by graphics() when windows scale setting is over 100%.
Read more >
Window.devicePixelRatio - Web APIs | MDN
A double-precision floating-point value indicating the ratio of the display's resolution in physical pixels to the resolution in CSS pixels. A ...
Read more >
How to fix incorrect element size on browser scaling?
Consider we have a 72x100px PNG image which is called pic.png. Its left half is yellow and the right half is black. Then...
Read more >
To those with a 4k monitor, on default scaling does ... - Reddit
Point of 4k is to see crisp and clear stuff. Scaling doesn't change that. Number of pixels on your screen and pixel depth...
Read more >
Mac Pro Nvidia Graphics Displays Incorrect Resolution
This discrepancy is on the "default" resolution scaling. ... DELL P2415Q: Resolution: 1920 x 1080 @ 60Hz (1080p) Pixel Depth: 32-Bit Color ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found