Closed MAYAS3 closed 1 year ago
This is the intended behavior.
The target aspect ratio is always preserved and depends on the format used. For example, throughout skylibs, the latlong
representation is always 2:1, while skylatlong
is 4:1. This is to ensure pixels cover mostly the same angle in both horizontal and vertical axes.
If the aspect ratio were not preserved, the result would be an anamorphic image. For example, in your case (latlong 256x256 panorama), pixels would cover ~1.4° x 0.7°. This would break downstream functionalities such as solid angle computation, and would not fit the definition we use of a latlong
format. In addition, this library was built with appearance modeling in mind, for which anamorphic panoramas would produce an undesirable anisotropic blur (one axis has more frequencies than the other). We felt like either breaking downstream functionalities, changing the format on-the-fly, or applying anisotropic blur would all surprise the user and lead to hidden bugs in their code.
I know however that other fields (such as geophysics and their spherical harmonic libraries) are known to use the latlong
format with a 1:1 aspect ratio, so it's a matter of convention. Let me know if you have a specific use case in mind, we are open to providing the functionality if there is a need for it.
Thank you for your answer! It clarifies things!
Hello @soravux,
It seems there's a little incoherence when resizing an environment map using the
resize()
method.I have 2048x1024 images that I'm trying to resize to 256x256 but even when I pass a tuple to the
resize()
method I get a 512x256 result instead. This is due to the fact that the code checks if the original height is divisible by the new one (here), but then applies the same downscaling factor for both the height and the width (here). Is this the intended behaviour (given that when the divisibility condition isn't met, the target height and width are both respected here)?Thanks in advance for your response!