Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nodata values at source edges #38

Open
systemed opened this issue Jul 17, 2022 · 0 comments
Open

Fix nodata values at source edges #38

systemed opened this issue Jul 17, 2022 · 0 comments

Comments

@systemed
Copy link

systemed commented Jul 17, 2022

This is in case anyone else runs into the same issue, really.

I was having issues with artefacts at the edges of source images, caused by nodata values. Adding a call to numpy's nan_to_num in data_to_rgb (encoders.py) fixes it:

data /= interval
data = np.nan_to_num(data, True, 100000.0)
data = np.around(data / 2**round_digits) * 2**round_digits

(100000.0 is from the -b and -i values of my invocation and shouldn't be hardcoded, obviously.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant