mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.16k stars 712 forks source link

Blurred tiles #1100

Closed mschmitt closed 1 year ago

mschmitt commented 2 years ago

Hello!

First of all, thanks a lot for your work on Pannellum, which always performs wonderfully everywhere I take it.

Right now I'm dealing with a small issue that looks like one of those internet rendering flaws to the causual viewer, but I've discovered a bit of a system behind it. The issue is, that somewhere between moving multires generation from a hosted VPS to a local server at my home and a few Debian upgrades (oh, and also increasing panorama resolution a LOT), my setup has started to give me a set of blurred tiles (when fully zoomed out) in a square around the nadir of the photo. Three of them square, one L-shaped.

Examples:

Imagine a radius of about 1-2 meters around the nadir and they should be easy to spot. In the attached crop from the second example, one patch is under the bench and one is visible on the right.

grafik

The respective configurations:

Raw panoramas:

The blurred tiles are visible browser- and client-independently, so I imagine the blur must be happening either in generate.py, in Python's PIL or somewhere in the interaction between the viewer and the multires directories.

Invocation of generate.py:

generate.py -q 95 -o "${pano_dir}" "${file}"

If I can provide any other details or test things, please let me know.

mschmitt commented 2 years ago

After further investigation it seems that the issue always affects the small square tiles in the "2" directory:

In the following example, I have filled those tiles with a bright red color.

https://pano.stoppedphoto.com/pannellum.htm?config=20220613_190103/config.json

With the replaced tiles, a red flicker is sometimes visible at the respective positions when the panorama is carefully scrolled. I believe that along with the web server log file, this shows that they are requested from the server but some sort of display issue happens.

The original tiles look nice and sharp:

mpetroff commented 1 year ago

Very interesting. I think this is an edge case I missed when optimizing the tile display in 05dae19b2806fd01665351ab0f83a8bd203494ed.

Before, a single tile resolution was used everywhere, which led to too much resolution in the middle and not enough resolution at the edges. Now, the resolution is picked on a per-tile basis, which resolved issues with blurry edges, particularly when zoomed out a lot, and is more efficient.

Could you please provided the resolution of the input panorama that was fed to generate.py? This will make it easier to debug the conditions that lead to this issue.

mschmitt commented 1 year ago

Thanks Matt! The two panoramas in the Dropbox folder (linked above) are:

20220623_090358_IMG_2870_Panorama_a.jpg 15784x7892 20220701_180043_IMG_3091_Panorama_a.jpg 15824x7912

mpetroff commented 1 year ago

I just fixed this in 950a2ce732cbe8d91f2b5483eaef175eee19675b. An edge case wasn't being handled properly.

mschmitt commented 1 year ago

Looks perfect, thanks a lot for the fix!