MCPcopy Create free account
hub / github.com/LCBOWER33/StegoScan / extract_lsb_and_normalize

Function extract_lsb_and_normalize

StegoScan.py:803–810  ·  view source on GitHub ↗

Extracts the specified number of least significant bits and normalizes them. - Keeps only the lowest `bits` LSBs of each channel. - Normalizes the result to fill the 8-bit range for visibility.

(image, bits)

Source from the content-addressed store, hash-verified

801
802
803def extract_lsb_and_normalize(image, bits):
804 """
805 Extracts the specified number of least significant bits and normalizes them.
806 - Keeps only the lowest `bits` LSBs of each channel.
807 - Normalizes the result to fill the 8-bit range for visibility.
808 """
809 lsb_image = image & ((1 << bits) - 1) # Keep only the `bits` least significant bits
810 return (lsb_image * (255 // ((1 << bits) - 1))).astype(np.uint8) # Normalize
811
812
813def is_elf_using_yara(filepath):

Callers 1

object_detectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected