reshape using image stride
This commit is contained in:
parent
d4d1687851
commit
b8b7dcf757
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue