ITADN

Ensures adain_npy returned pixel value is within the range of bit depth

#393Pull Requestkennethxu 创建于 2024-08-09
K
kennethxucommented
This fixes #222. The normalization process of `adain_npy` can generate pixel values out of the range of bit depth. For example, it computed values less than 0 or greater than 256 for 8-bit images. When this happens, the later process will consider the image to be 16 bit and resulting in an entirely black image. The solution is to compute a proper ratio to reduce `style_std` so that no pixel would exceed the range of original bit depth while still apply the style in the best effort.
合并状态:未合并 0 条评论