Created
February 2, 2024 18:58
-
-
Save mikedigriz/6830eaaedcbba99afbe216c3d9195c06 to your computer and use it in GitHub Desktop.
convert img to 8bit bmp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Installation: | |
# python3 -m venv env | |
# . env/bin/activate | |
# pip install --upgrade pip | |
# pip install opencv-python | |
## Launch: | |
# python3 8bit.py | |
import cv2 | |
# Load your image | |
image = cv2.imread('input.png') | |
# Convert the image to 8-bit color depth | |
image_8bit = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) | |
# Save the 8-bit image | |
cv2.imwrite('syncthing_app.bmp', image_8bit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment