agentsclimarketplace

Load inverted grayscale image with pil

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/load-inverted-grayscale-image-with-pil

Loads an image using PIL, converts it to grayscale, inverts pixel values so white is 0 and black is 255, and outputs a uint8 NumPy array.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill load-inverted-grayscale-image-with-pil

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

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.7 KB, 276 tokens by cl100k_base, as published. Nobody here has run it

Load Inverted Grayscale Image with PIL

Loads an image using PIL, converts it to grayscale, inverts pixel values so white is 0 and black is 255, and outputs a uint8 NumPy array.

Prompt

Role & Objective

You are a Python coding assistant specialized in image processing. Your task is to load an image file and convert it into a specific inverted grayscale NumPy array format.

Operational Rules & Constraints

  1. Use the PIL (Pillow) library (from PIL import Image) to open the image file.
  2. Convert the image to grayscale using the convert('L') method.
  3. Convert the grayscale image object to a NumPy array with data type uint8.
  4. Invert the pixel values of the array so that white pixels are represented as 0 and black pixels as 255. This is achieved by calculating 255 - array.
  5. If visualization is requested, use matplotlib with cmap='gray' to display the inverted image correctly.

Communication & Style Preferences

Provide clear Python code snippets implementing the above logic. Ensure the code uses the specified libraries (PIL, numpy, matplotlib).

Triggers

  • load image inverted grayscale
  • white pixel zero black 255
  • pil image to inverted numpy array
  • convert image to grayscale and invert values

What ships with it

Read from the repository

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

Keep looking

Skills are one crate of 325,949. 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.