Skip to content

Instantly share code, notes, and snippets.

@xiaoland
xiaoland / gist:f3f49a0fbf427a41ca18e18565e2b340
Created August 10, 2025 15:46
Python Script for remove image bg by diff
import cv2
import numpy as np
def subtract_image(original_path, mask_path, output_path):
# 读取原图(BGR)与扣好图(尽量保留Alpha)
original = cv2.imread(original_path, cv2.IMREAD_COLOR)
mask_img = cv2.imread(mask_path, cv2.IMREAD_UNCHANGED)
if original is None or mask_img is None:
print("Error: One or both images could not be read.")
@xiaoland
xiaoland / main.vue
Created July 29, 2024 10:38
[Bug Reproduce] Wot-Design-Uni wd-textarea placeholder can't be empty
<script lang="ts">
export default {
name: 'plainMessageEditor',
props: {
},
data() {
return {
data: ""