agentsclimarketplace

Grayscale conversion

Skill cxcscmu/SkillLearnBench/skills/b4-skill-creator-claude-opus-4-6/video-object-counting/grayscale-conversion

Convert RGB images to grayscale using OpenCV (cv2) in Python. Use this skill when the user needs to convert color images to grayscale for image processing, template matching, or analysis.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill grayscale-conversion

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

0.9 KB, 189 tokens by cl100k_base, as published. Nobody here has run it

Grayscale Image Conversion

Convert RGB/BGR images to grayscale using OpenCV.

Python Code

import cv2

img = cv2.imread("input.png")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite("input.png", gray)  # overwrite in-place

Batch Conversion

import cv2
import glob

for path in sorted(glob.glob("/root/keyframes_*.png")):
    img = cv2.imread(path)
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    cv2.imwrite(path, gray)

Notes

  • OpenCV reads images in BGR format, so use COLOR_BGR2GRAY
  • Writing a grayscale image back with cv2.imwrite produces a single-channel PNG
  • Grayscale conversion is often a prerequisite for template matching with cv2.matchTemplate

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,852. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.