Image grayscale
Use this skill to convert RGB images to grayscale. It provides methods using common libraries like OpenCV or PIL.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill image-grayscaleAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.9 KB, 193 tokens by cl100k_base, as published. Nobody here has run it
Image Grayscale Conversion Skill
This skill provides instructions for converting RGB images to grayscale.
Using OpenCV (Python)
If OpenCV is available, use the following code:
import cv2
def convert_to_grayscale(image_path):
img = cv2.imread(image_path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite(image_path, gray) # Overwrite original
Using PIL (Python)
If PIL (Pillow) is available:
from PIL import Image
def convert_to_grayscale(image_path):
img = Image.open(image_path).convert('L')
img.save(image_path) # Overwrite original
Using ImageMagick (CLI)
If ImageMagick is available:
mogrify -colorspace gray image.png
Verification
Confirm the image is grayscale by checking its mode or channels.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.