fany algorithm: assuming lightmap has proper padding: 1. binarisize lightmap, then per uv isle go linewise and count jumps from 1 to 0 and vice versa, then same for colums and add, then each uv isle has its specific value, and normalized(biggest = 1) is the scale factor, then scaling uv isles according to scale factor.…