Skip to content

Instantly share code, notes, and snippets.

@ranggakd
Last active September 12, 2023 05:23
def merge_two_half_bits(self, pos: str):
'''Merge two half bits images.'''
self.merged_image = self.original_cover_image.copy()
pos_slice = self.get_slicing(
self.merged_image.shape,
self.left_half_bits_hidden_image.shape,
pos
)
# assign the left half bits hidden image into subarray of cover image
# separate the color channels
for channel in range(3):
self.merged_image[pos_slice][..., channel] = self.__mb_lookup[
self.merged_image[pos_slice][..., channel],
self.left_half_bits_hidden_image[..., channel]
]
self.merged_image = self.merged_image.astype('uint8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment