doc: readme with community QR code (#67)
This commit is contained in:
committed by
GitHub
Unverified
parent
b4d6e62055
commit
748cd83c73
13
README.md
13
README.md
@@ -38,6 +38,16 @@ Whether you're automating workflows, managing AI-powered channels, or scheduling
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Community
|
||||||
|
|
||||||
|
Join our community to connect with other users, get support, and share your experiences.
|
||||||
|
|
||||||
|
| Enterprise WeChat | Feishu Group | Discord |
|
||||||
|
| :---: | :---: | :---: |
|
||||||
|
| <img src="src/assets/community/wecom-qr.png" width="150" alt="WeChat QR Code" /> | <img src="src/assets/community/feishu-qr.png" width="150" alt="Feishu QR Code" /> | <img src="src/assets/community/20260212-185822.png" width="150" alt="Discord QR Code" /> |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Why ClawX
|
## Why ClawX
|
||||||
|
|
||||||
Building AI agents shouldn't require mastering the command line. ClawX was designed with a simple philosophy: **powerful technology deserves an interface that respects your time.**
|
Building AI agents shouldn't require mastering the command line. ClawX was designed with a simple philosophy: **powerful technology deserves an interface that respects your time.**
|
||||||
@@ -297,6 +307,9 @@ ClawX is built on the shoulders of excellent open-source projects:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
ClawX is released under the [MIT License](LICENSE). You're free to use, modify, and distribute this software.
|
ClawX is released under the [MIT License](LICENSE). You're free to use, modify, and distribute this software.
|
||||||
|
|||||||
54
scripts/crop_qr.py
Normal file
54
scripts/crop_qr.py
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
import os
|
||||||
|
from PIL import Image, ImageChops
|
||||||
|
|
||||||
|
def trim_whitespace(im):
|
||||||
|
bg = Image.new(im.mode, im.size, im.getpixel((0,0)))
|
||||||
|
diff = ImageChops.difference(im, bg)
|
||||||
|
diff = ImageChops.add(diff, diff, 2.0, -100)
|
||||||
|
bbox = diff.getbbox()
|
||||||
|
if bbox:
|
||||||
|
return im.crop(bbox)
|
||||||
|
return im
|
||||||
|
|
||||||
|
def process_image(path):
|
||||||
|
try:
|
||||||
|
img = Image.open(path)
|
||||||
|
img = img.convert("RGBA")
|
||||||
|
|
||||||
|
# Simple trim of uniform background
|
||||||
|
cropped = trim_whitespace(img)
|
||||||
|
|
||||||
|
# If the image is a "photo", simple trim might not work if lighting is uneven.
|
||||||
|
# But let's assume digital image for now based on typical user behavior.
|
||||||
|
# Function to find the QR code area more robustly:
|
||||||
|
# Convert to grayscale, threshold, invert, find bbox of black pixels.
|
||||||
|
gray = img.convert("L")
|
||||||
|
# Threshold: anything darker than 200 is "black" (QR code), else white
|
||||||
|
bw = gray.point(lambda x: 0 if x < 200 else 255, '1')
|
||||||
|
# Invert to make QR code white on black background for getbbox
|
||||||
|
bw_inv = ImageChops.invert(bw)
|
||||||
|
bbox = bw_inv.getbbox()
|
||||||
|
|
||||||
|
if bbox:
|
||||||
|
# Add a small padding
|
||||||
|
left, upper, right, lower = bbox
|
||||||
|
width, height = img.size
|
||||||
|
left = max(0, left - padding)
|
||||||
|
upper = max(0, upper - padding)
|
||||||
|
right = min(width, right + padding)
|
||||||
|
lower = min(height, lower + padding)
|
||||||
|
cropped = img.crop((left, upper, right, lower))
|
||||||
|
|
||||||
|
cropped.save(path)
|
||||||
|
print(f"Processed {path}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error processing {path}: {e}")
|
||||||
|
|
||||||
|
assets_dir = "src/assets/community"
|
||||||
|
for filename in ["feishu-qr.png", "wecom-qr.png"]:
|
||||||
|
file_path = os.path.join(assets_dir, filename)
|
||||||
|
if os.path.exists(file_path):
|
||||||
|
process_image(file_path)
|
||||||
|
else:
|
||||||
|
print(f"File not found: {file_path}")
|
||||||
BIN
src/assets/community/20260212-185822.png
Normal file
BIN
src/assets/community/20260212-185822.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
BIN
src/assets/community/feishu-qr.png
Normal file
BIN
src/assets/community/feishu-qr.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
BIN
src/assets/community/wecom-qr.png
Normal file
BIN
src/assets/community/wecom-qr.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
Reference in New Issue
Block a user