You are not logged in.

kme

Intermediate

  • "kme" started this thread

Posts: 265

Location: Belgium

Occupation: Long time coder, product manager and 3D enthousiast

  • Send private message

1

Friday, March 24th 2023, 11:47pm

Hotspot sharpening

I was wondering if there is any sharpening applied when viewing a hotspot in krpano.

Hotspot is an img hotspot.
The original image is here:
https://www.pexels.com/photo/smiling-gir…k-shirt-774091/

When viewed at 25% in photoshop, I see something like this (best viewed in new window)



But when I view inside krpano on a hotspot at approximate the same size as 25% in photoshop, there are some noticable artifacts visible. See screenshot (best viewed in new window):



I tried playing around with scale/width/height but when using the original image, it really did not matter.
The best thing to do was to scale down the original image before importing it into krpano, but in that case, when zooming in on the image (to 100% of the original size), the image becomes pixelated.

I'm assuming this is due to the scaling algorithm used? Is there something we can do to control the sharpening?

gr,
Kme

kme

Intermediate

  • "kme" started this thread

Posts: 265

Location: Belgium

Occupation: Long time coder, product manager and 3D enthousiast

  • Send private message

2

Saturday, March 25th 2023, 9:28am

Found the time to put an example online:

Left image: original
Right image: scaled to 25% in photoshop

https://krpano.kri-soft.be/examples/hotspotsharpening/

Also note that with these resolutions, the left image allows for getting real close, but the right image starts to show pixelated pretty quick (due to lack of resolution).

kme

3

Saturday, March 25th 2023, 1:49pm

Hi,

that's normal and how real-time computer graphics are working (and not krpano related).

When an image is larger than it will be displayed, then pixels from that image would get skipped - there is no sampling/averaging of pixel-areas, that would be way too slow.

But there is a way to avoid such problem in computer graphics: Mipmapping

It can be enabled using this setting:
https://krpano.com/docu/xml/#hotspot.mipmapping

But to able to use that, the source image needs to have a 'power-of-two-size' (e.g. 1024, 2048, 4096, ...).
E.g. scale the image first to the next/near power-of-two width and height and then in the xml set the original image-size to correct the image-aspect.

There is also a way to avoid the need for power-of-two-sized images by enabling the WebGL2 API, but that's not available on all devices:
https://krpano.com/docu/embedpano/#webglsettings

Best regards,
Klaus