Skip to content

Bit Number Slicing

Jeet edited this page Jul 26, 2022 · 1 revision

We set the given bit to zero (for all pixels) with this method. This is different from bit plane slicing where multiple bits were set to zero

Command Line

Original image:

Original Image

2nd bit:

$loomis -command bitnumber_slicing -bit 2 testdata/green-bee-eater-grayscale.jpg

2nd bit

NOTE: Setting the third bit to zero seems to be losing more information than setting both 1 and 0 to zero. There may a bug in one of the implementations.

4th bit:

$loomis -command bitnumber_slicing -bit 4 testdata/green-bee-eater-grayscale.jpg

4th bit

7th bit:

$loomis -command bitnumber_slicing -bit 7 testdata/green-bee-eater-grayscale.jpg

7th bit

Library Usage

newImage := pkg.BitPlaneSlicingBitNumber(image, bitNumber)

image is of type image.Image
numberOfBits is a number between 0 and 7 representing the bit that will be set to zero

Clone this wiki locally