Logo 2d Pixel Asset

2d Pixel Asset

Cộng đồng
maystudios
2d-pixel-asset

Generate 2D pixel art game assets using Google Gemini via Chrome browser automation. Triggers when the user wants to create pixel art, game sprites, tilesets, game assets, or edit existing game art. Supports reference image uploads for style consistency, model selection (Flash/Pro), resolution control, automatic background removal (chroma key, ML-based via BiRefNet, or Adobe Express), and rasterization to exact pixel dimensions. Use for requests like "create a pixel art sword", "generate a 32x32 character sprite", "make a tileset", or "edit this sprite".

Tổng quan

Nhà phát hànhmaystudios
Kho mãclaude-skills
Tên kỹ năng2d-pixel-asset
Sao
30
Bản fork
3
Tệp đi kèm
2
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 2 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được maystudios công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI 2d Pixel Asset trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/maystudios/claude-skills/tree/main/2d-pixel-asset
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maystudios/claude-skills.git /tmp/claude-skills
mkdir -p .claude/skills
cp -r /tmp/claude-skills/2d-pixel-asset .claude/skills/2d-pixel-asset
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật 2d Pixel Asset trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp 2d Pixel Asset ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng 2d Pixel Asset với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

2D Pixel Asset Generator via Gemini + Chrome

Generate pixel art game assets through Google Gemini's web interface using Chrome browser automation, then post-process them to exact pixel dimensions with transparent backgrounds.

Prerequisites

  • Chrome browser with the Claude-in-Chrome extension installed and active
  • User logged into Google account at https://gemini.google.com
  • Chrome MCP tools available (mcp__claude-in-chrome__*)
  • Python 3 with Pillow installed (for post-processing)
  • For ML background removal: pip install transformers torch torchvision + CUDA GPU
  • For Adobe Express removal: User logged into Adobe account

Tool Loading

Before using ANY Chrome MCP tool, load it via ToolSearch first:

ToolSearch: "select:mcp__claude-in-chrome__tabs_context_mcp"
ToolSearch: "select:mcp__claude-in-chrome__tabs_create_mcp"
ToolSearch: "select:mcp__claude-in-chrome__navigate"
ToolSearch: "select:mcp__claude-in-chrome__computer"
ToolSearch: "select:mcp__claude-in-chrome__find"
ToolSearch: "select:mcp__claude-in-chrome__upload_image"

Tool Mapping

ActionMCP Tool
Get tab contextmcp__claude-in-chrome__tabs_context_mcp
Create new tabmcp__claude-in-chrome__tabs_create_mcp
Navigate to URLmcp__claude-in-chrome__navigate
Click, type, screenshot, hover, waitmcp__claude-in-chrome__computer
Find elements by descriptionmcp__claude-in-chrome__find
Upload reference/edit imagesmcp__claude-in-chrome__upload_image
Read page contentmcp__claude-in-chrome__read_page

CLI Arguments

Parse these from user input after the skill invocation:

ArgumentDefaultDescription
(positional)--Main prompt text (everything not a flag)
--size 32 or --size 64x3232Target pixel dimensions for final output
--output path/./Assets/Output directory
--name filenamederived from promptOutput filename (no extension)
`--model proflash`pro
--ref path1.png path2.png ...noneReference images for style (up to 14)
--edit path.pngnoneExisting image to edit/modify
--tilefalseGenerate tileable texture (no bg removal)
`--resolution 1k2k4k`
--no-processfalseSkip post-processing, keep raw output
`--bg-color magentagreenwhite`
--mlfalseUse BiRefNet ML model for background removal
--adobefalseUse Adobe Express for background removal
--margin N1Transparent margin (px) around sprite in final output

Workflow

Aspect Ratio Handling

CRITICAL: Match the Gemini prompt aspect ratio to the target --size.

Before constructing the prompt, run the script to get the best matching Gemini ratio:

bash
python "path/to/2d-pixel-asset/scripts/process_asset.py" \
  --size {target_size} --suggest-ratio

This outputs the closest Gemini-supported ratio (e.g., 3:2, 16:9, 4:3). Use this ratio in the prompt as Aspect ratio {ratio}.

Examples:

  • --size 32 → 1:1
  • --size 128x64 → 16:9
  • --size 64x128 → 9:16
  • --size 96x128 → 3:4
  • --size 192x128 → 3:2

Also add to the prompt: "The subject must be centered and fill the entire canvas from edge to edge with minimal empty space around it."

After post-processing: If the script outputs a WARNING about aspect ratio mismatch, inform the user and offer to either:

  1. Re-generate with the correct aspect ratio prompt
  2. Accept the result with transparent padding on the shorter axis

Step 1: Initialize Browser Session

1. Call tabs_context_mcp to discover existing tabs
2. Call tabs_create_mcp to create a fresh tab
3. Navigate to https://gemini.google.com/app
4. Take a screenshot with computer to verify the page loaded

Step 2: New Chat + Enable Image Generation

IMPORTANT: The Gemini UI is in GERMAN.

1. Use find to locate "Neuer Chat" button, click it with computer
2. Take a screenshot to confirm new chat is open
3. Use find to locate "Tools" button, click it
4. Use find to locate "Bild erstellen" toggle/option, click it to enable
5. Take a screenshot to confirm image generation is enabled

Step 3: Model Selection

Default model is Pro. The model selector shows "Schnell" near the bottom-right of the input area.

If user specified --model pro (or no --model flag):
  1. Use find to locate the model dropdown showing "Schnell"
  2. Click it to open the model selector
  3. Select the option labeled with "Pro"
  4. Take a screenshot to confirm Pro is selected

If user specified --model flash or --flash:
  1. Keep "Schnell" (Flash) -- no action needed

Step 4: Upload Reference Images (if --ref provided)

1. For each reference image path:
   a. Use upload_image to upload the file
2. Maximum 14 reference images supported
3. Take a screenshot to verify uploads appear in the input area

Step 5: Upload Existing Image for Editing (if --edit provided)

1. Use upload_image to upload the specified image
2. The modification instructions will be included in the prompt
3. Take a screenshot to verify the image appears in the input area

Step 6: Construct and Submit the Prompt

Build the prompt by combining the user's core request with pixel art defaults.

Always include these elements:

  1. Resolution directive: "Generate in {resolution} resolution" (default 1K)
  2. Pixel art style: "pixel art sprite, thick black outlines, no anti-aliasing, clean pixel edges"
  3. Background handling (based on --bg-color, default magenta):
    • For sprites with magenta bg: "Isolated on a solid, flat, uniform magenta background. Use EXACTLY hex color #FF00FF (RGB 255, 0, 255). The entire background must be a single pure magenta color with absolutely zero variation. Flat, even, uniform lighting across the entire image."
    • For sprites with green bg: "Isolated on a solid, flat, uniform chromakey green background. Use EXACTLY hex color #00FF00 (RGB 0, 255, 0). The entire background must be a single pure green color with absolutely zero variation. Flat, even, uniform lighting across the entire image."
    • For sprites with white bg: "Isolated on a solid, flat, uniform pure white background. Flat, even, uniform lighting across the entire image."
    • For tiles (--tile): "seamless tileable texture, fills the entire rectangular canvas"
  4. User's core prompt as the main subject description

Prompt template (sprites -- default magenta):

Create a pixel art sprite of {user_prompt}. Pixel art style with thick black outlines,
no anti-aliasing, clean pixel edges. The subject must be centered and fill the entire
canvas from edge to edge with minimal empty space around it. Isolated on a solid, flat,
uniform magenta background. Use EXACTLY hex color #FF00FF (RGB 255, 0, 255). The entire
background must be a single pure magenta color with absolutely zero variation. Flat, even,
uniform lighting across the entire image. Generate in {resolution} resolution.
Aspect ratio {aspect_ratio}.

Prompt template (tiles):

Create a seamless tileable pixel art texture of {user_prompt}. Pixel art style with
no anti-aliasing, clean pixel edges. The texture must fill the entire rectangular canvas
with no borders or margins. Seamlessly tileable in all directions. Generate in {resolution}
resolution.

Prompt template (edit mode with --edit):

Modify this pixel art: {user_prompt}. Maintain the pixel art style with thick black
outlines, no anti-aliasing. Keep everything else exactly the same unless specified.
Generate in {resolution} resolution.

Reference: See references/prompting-guide.md for detailed prompt construction strategies, style descriptors, and examples.

Submitting:

1. Use find to locate the prompt input field
2. Type the constructed prompt using computer action "type"
3. Press Enter to submit
4. Wait 10 seconds (computer wait action)
5. Wait another 10 seconds (computer wait action)
6. Take a screenshot to verify the image was generated

Step 7: Download the Generated Image

1. Hover over the generated image using computer action "hover"
2. Look for the download button (arrow icon, top-right of image on hover)
3. Use find to locate the download button ("Bild in Originalgröße herunterladen")
4. Click the download button using the found ref
5. Wait 5 seconds for the download to complete
6. Find the downloaded file:
   ls -t ~/Downloads/*.png | head -5

Step 8: Post-Processing (Background Removal + Rasterize)

Skip this step if --no-process is set.

Choose background removal strategy

Decision logic (follow in order):

  1. If --ml flag: use BiRefNet ML model
  2. If --adobe flag: use Adobe Express (Step 8b)
  3. If --tile flag: skip background removal (--no-remove-bg)
  4. Default: use chroma key with --bg-color (default: magenta)

After downloading, take a screenshot of the generated image and visually inspect it. If the background looks unclean (gradients, shadows, mixed colors) despite the magenta prompt, consider switching to --ml for that image.

8a: Script-based removal (chroma key or ML)
bash
# Default: Chroma key magenta
python "path/to/2d-pixel-asset/scripts/process_asset.py" \
  ~/Downloads/{downloaded_file}.png \
  --size {target_size} \
  --bg-color magenta \
  --output {output_path}/{filename}.png

# ML fallback (BiRefNet):
python "path/to/2d-pixel-asset/scripts/process_asset.py" \
  ~/Downloads/{downloaded_file}.png \
  --size {target_size} \
  --ml \
  --output {output_path}/{filename}.png

# Green chroma key:
python "path/to/2d-pixel-asset/scripts/process_asset.py" \
  ~/Downloads/{downloaded_file}.png \
  --size {target_size} \
  --bg-color green \
  --output {output_path}/{filename}.png

# Legacy white:
python "path/to/2d-pixel-asset/scripts/process_asset.py" \
  ~/Downloads/{downloaded_file}.png \
  --size {target_size} \
  --bg-color white \
  --output {output_path}/{filename}.png
  • Default --size: 32 (produces 32x32). For non-square: --size 64x32.
  • If --tile is set: add --no-remove-bg flag (tiles keep their background).
8b: Adobe Express removal (if --adobe flag)

Use Chrome browser automation to remove background via Adobe Express:

1. Create a new tab or reuse existing
2. Navigate to https://new.express.adobe.com/home/tools/remove-background
3. Take a screenshot to verify page loaded
4. Find the upload area / "Browse" button
5. Upload the downloaded Gemini image using upload_image
6. Wait 10-15 seconds for Adobe to process
7. Take a screenshot to verify background was removed
8. Find and click the download button
9. Wait 5 seconds for download
10. Find the downloaded file:
    ls -t ~/Downloads/*.png | head -5
11. Then run process_asset.py with --no-remove-bg to only crop and rasterize:
    python "path/to/2d-pixel-asset/scripts/process_asset.py" \
      ~/Downloads/{adobe_result}.png \
      --size {target_size} \
      --no-remove-bg \
      --output {output_path}/{filename}.png

Step 9: Move to Final Location

1. Ensure output directory exists: mkdir -p {output_dir}
2. If --no-process was set, move raw file:
   mv ~/Downloads/{file}.png {output_dir}/{name}.png
3. Report the final file path to the user

Prompt Enhancement for Pixel Art

When enhancing the user's prompt, apply these pixel-art-specific principles:

  • Color palette: Suggest limited palettes ("16-color palette", "NES palette", "earthy tones with 8 colors")
  • Perspective: Specify view ("top-down view", "3/4 isometric view", "side-scrolling profile view", "front-facing")
  • Animation frames: For sprite sheets, specify "single frame, static pose" unless animation is requested
  • Scale reference: Mention intended use ("suitable for 32x32 grid", "character sprite for 2D platformer")
  • Outlines: Always specify "thick black outlines" for sprites, optional for tiles
  • Shading: "flat shading" or "simple 2-tone shading" -- avoid gradients
  • Positive framing: Describe what to include, not what to exclude. Say "flat uniform lighting" instead of "no shadows"

Error Handling

  • Page doesn't load: Retry navigation, verify internet connection
  • Image generation fails: Simplify the prompt, reduce complexity
  • Download button not visible: Use find to locate "Bild in Originalgröße herunterladen" button by ref
  • File not in Downloads: Wait 5 more seconds, check with ls -t ~/Downloads/*.png | head -5
  • Chroma key leaves residue: Switch to --ml flag for that image
  • ML model fails to load: Check torch/transformers installation, verify CUDA available
  • Adobe Express upload fails: Verify user is logged into Adobe account
  • Model selector not found: Take a screenshot, look for alternative UI elements near the input area
  • "Bild erstellen" not found: Try searching for "Bilderstellung" or take a screenshot to identify the correct German label

Important Notes

  • Always create a NEW chat for each generation to avoid context pollution from previous prompts
  • The Gemini UI is in GERMAN -- all button labels use German text (Neuer Chat, Tools, Bild erstellen, Schnell)
  • Load Chrome MCP tools via ToolSearch before every use
  • Generated images include C2PA Content Credentials and SynthID watermarks
  • Default output directory is ./Assets/ relative to the user's current working directory
  • Default background color is magenta (#FF00FF) -- avoids conflicts with common game art colors
  • The process_asset.py script requires Python 3 and Pillow (pip install Pillow)
  • For ML removal, install: pip install transformers torch torchvision
  • BiRefNet model (~1GB) downloads on first use to HuggingFace cache

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI 2d Pixel Asset làm được gì?

Generate 2D pixel art game assets using Google Gemini via Chrome browser automation. Triggers when the user wants to create pixel art, game sprites, tilesets, game assets, or edit existing game art. Supports reference image uploads for style consistency, model selection (Flash/Pro), resolution control, automatic background removal (chroma key, ML-based via BiRefNet, or Adobe Express), and rasterization to exact pixel dimensions. Use for requests like "create a pixel art sword", "generate a 32x32 character sprite", "make a tileset", or "edit this sprite".

Vì sao nên dùng 2d Pixel Asset trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. 2d Pixel Asset là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài 2d Pixel Asset trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/maystudios/claude-skills/tree/main/2d-pixel-asset. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng 2d Pixel Asset?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng 2d Pixel Asset với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng 2d Pixel Asset với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI 2d Pixel Asset có miễn phí không?

Có. Kỹ năng này được maystudios phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇