1
0
Fork 0

reshape using image stride

This commit is contained in:
Sean Sube 2023-01-14 16:00:12 -06:00
parent d4d1687851
commit b8b7dcf757
1 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,8 @@ def blend_source_histogram(source_image: Image, dims: Tuple[int, int]) -> Tuple[
noise_g = random.choice(256, p=np.divide(np.copy(hist_g), np.sum(hist_g)), size=size)
noise_b = random.choice(256, p=np.divide(np.copy(hist_b), np.sum(hist_b)), size=size)
noise = Image.fromarray(np.reshape(np.dstack((noise_r, noise_g, noise_b)), (1, size*3)))
noise_pixels = np.dstack((noise_r, noise_g, noise_b))
noise = Image.fromarray(np.reshape(noise_pixels), (width * 3, height)))
return noise