danielgatis

Stars and mentions

Last 30 days, Oct 4 – Nov 2

GitHub stars256
mentions11
08162432Oct 4Oct 18Nov 2
UTC days · repositories danielgatis owns11 repositories

Package downloads

Cumulative recorded downloads · since 2025-10-26

crates.io—
npm—
PyPI20.8M
05.2M10.4M15.6M20.8MOct 4Oct 18Nov 2
Oct 26crates.io: 0/1 packages observed · npm: 0/1 packages observed · PyPI: 1/1 packages observed

Across 3 known packages in repositories danielgatis owns. Cumulative totals include recorded downloads before the selected range. Missing observations leave gaps; totals may be incomplete. PyPI excludes known mirrors.

Top repositories

danielgatis’s repositories ranked by new stars, as on trending.

Loading

Contributes to

Repositories outside danielgatis’s account where danielgatis opened or reviewed pull requests in the past 365 days.

Who noticed danielgatis

Everyone who starred or forked danielgatis’s repositories since the archive began in 2011.

Notable accounts

Ordered by the stars their own repositories have received.

Biggest fans

Accounts that starred the most of these repositories.

Breakout weeks

Each repository’s best week of new stars, with the release published around it.

Mentions

12posts
Nov 31 post
  1. rembg on PyPI: pypi.org rembg on GitHub: danielgatis/rembg remove.bg pricing roundup (smallest monthly plan $9 for 40 credits): ampm-aiops.com remove.bg API pricing comparison: snapedit.app Demo photo source (white ceramic mug stock sample): vecteezy.com

    1 like · 10 views
  2. Need repeatable image cutouts? rembg handles single files or whole folders from Python/CLI, with local CPU/GPU options. Check model licenses: its default RMBG-2.0 needs a separate agreement for commercial use. Review edges before shipping. danielgatis/rembg

    9 views
  3. 冷知识,任何人都不用为了抠图专门买会员,也不用一张张手动去背景。 GitHub 上有个开源项目叫 rembg,可以批量处理图片。直接告诉一个能执行代码的好模型。 你可以检索 GitHub 上任何图像处理项目,把我这 100 张图片的背景全部去掉,保留头发和物体边缘,输出透明 PNG,效果不好的自动标出来让我检查。 项目地址在这:danielgatis/rembg

    1 like
  4. 3) rembg: tira o fundo de imagens no seu PC. "rembg p entrada saida" faz uma pasta inteira de uma vez. Atenção: o modelo padrão (RMBG-2.0, da BRIA) pede acordo pago pra uso comercial. Pra thumb de canal monetizado, use -m birefnet-general (MIT). danielgatis/rembg

    4 views
  5. Bulk-remove backgrounds from product photos for Amazon and Shopify (white or transparent) without paying remove.bg prices --- title: "Bulk-remove backgrounds from product photos for Amazon and Shopify (white or transparent) without paying remove.bg prices" published: true description: "A tested recipe: send hundreds of product photo URLs from a CSV or Google Sheet to an API, get pure-white JPGs or transparent PNGs back, pad them to square in Python. Real run numbers, costs for 500 images and the honest free alternatives." tags: ecommerce, python, ai, tutorial cover_image: raw.githubusercontent.com --- If you sell on Amazon or Shopify, you know the chore: the supplier sends 300 photos on red, grey and yellow backgrounds, and the marketplace wants a clean white main image. Doing that by hand in Photoshop takes an afternoon. Doing it with a per-image API gets expensive fast. This post shows the batch workflow I use: image URLs in, pure-white (or transparent) cut-outs out, then a few lines of Python to make them square. I ran everything below on 22 October 2026, and the numbers are from that run. Disclosure: I built the Apify actor used here (AI Background Remover). I also list the free options I'd use instead in some cases. What the marketplaces actually ask for Amazon (main image). Amazon's product image requirements ask for a pure white background (RGB 255, 255, 255) on the main image, with the product filling about 85% of the frame. There must be no text, logos or watermarks, and the whole product must be visible. Rules differ by category, so check the current guide for yours. Shopify. Shopify's product media documentation accepts images up to 5000 × 5000 px (20 megapixels, under 20 MB) and says square images of 2048 × 2048 px usually look best. White isn't required, but a consistent background across a collection looks much tidier. So the job is: remove the background, put the product on exact #ffffff, crop close, leave a small margin and output a square image. The test: three product photos I used three product photos from Unsplash (free under the Unsplash License, with commercial use allowed): a red sneaker on red, two smartwatches on light grey and headphones on yellow. No people. !Original product photos next to the white-background output Input: { "imageUrls": [ "https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=1200", "https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=1200", "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=1200" ], "outputFormat": "jpg", "backgroundColor": "#ffffff", "cropToObject": true, "padding": 40 } Results of the run: - Run time: 29 s for the whole run, including container start. The model itself took 3.5 s, 4.1 s and 10.2 s per image (IS-Net model, 2 GB memory). - Output: one JPG per image, cropped to the product with a 40 px margin: 805×748, 1135×813 and 623×654 px. - Background check: I read the pixels back in Pillow. All corners and the whole margin are exactly (255, 255, 255), not "almost white". - Cost to a user: 3 images × $0.006 = $0.018. Each result row looks like this: { "sourceUrl": "https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=1200", "status": "ok", "outputUrl": "https://api.apify.com/v2/key-value-stores/.../records/nobg-00001.jpg?signature=...", "width": 805, "height": 748, "model": "isnet-general-use", "processingSeconds": 3.49 } Want transparency instead? Set "outputFormat": "png" (or webp for smaller files) and leave backgroundColor empty. Step 1: one call with curl You need a free Apify account and an API token. The synchronous endpoint returns the result rows directly: curl -s -X POST \ "https://api.apify.com/v2/acts/fast_data_asap~ai-background-remover/run-sync-get-dataset-items?token=$APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"imageUrls":["https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=1200"], "outputFormat":"jpg","backgroundColor":"#ffffff","cropToObject":true,"padding":40}' Synchronous calls time out after 5 minutes, so use them for small batches only. Step 2: batch from a CSV or Google Sheet For hundreds of images, start a normal run and wait for it to finish. The script below reads a CSV that has an image_url column. A Google Sheet works too: share it as "anyone with the link" and use its CSV export URL. # pip install apify-client pillow requests import csv, io, os, requests from apify_client import ApifyClient from PIL import Image SHEET_CSV = "https://docs.google.com/spreadsheets/d/<SHEET_ID>/export?format=csv" rows = list(csv.DictReader(io.StringIO(requests.get(SHEET_CSV).text))) urls = [r["image_url"] for r in rows if r.get("image_url")] client = ApifyClient(os.environ["APIFY_TOKEN"]) run = client.actor("fast_data_asap/ai-background-remover").call(run_input={ "imageUrls": urls, "outputFormat": "jpg", "backgroundColor": "#ffffff", "cropToObject": True, "padding": 40, "maxInputMegapixels": 8, # keep more pixels for 2048 px output }) os.makedirs("white", exist_ok=True) for i, item in enumerate(client.dataset(run["defaultDatasetId"]).iterate_items()): if item["status"] != "ok": print("FAILED", item["sourceUrl"], item.get("error")) # failed images are not charged continue img = Image.open(io.BytesIO(requests.get(item["outputUrl"]).content)).convert("RGB") # pad to a square, then scale to 2048 x 2048 for Shopify side = max(img.size) square = Image.new("RGB", (side, side), (255, 255, 255)) square.paste(img, ((side - img.width) // 2, (side - img.height) // 2)) square.resize((2048, 2048), Image.LANCZOS).save(f"white/{i:04d}.jpg", quality=92) Two notes from testing: - Frame fill: with crop-to-object plus a small padding (around 2–5% of the longest side), the product fills roughly 90% of the square, which meets Amazon's ~85%. Raise padding if a product looks cramped. - Resolution: the actor processes at up to 4 MP by default (about 2000 × 2000 px). After cropping, the product is smaller than that. If your sources are large, raise maxInputMegapixels (up to 16). If your sources are small, scaling to 2048 px won't add real detail. What 500 images cost | Option | 500 images | Notes | |---|---:|---| | This actor | $3.00 | $6 per 1,000, down to $4.50 per 1,000 ($2.25) on higher Apify plans. Failed images are free. | | remove.bg pay-as-you-go | $199 | 500-credit pack, 1 credit per full-resolution image (pricing, checked Oct 2026) | | remove.bg subscriptions | varies | Cheaper per image at high volume (large plans work out to roughly $0.07/image), but it's a monthly commitment | | rembg / BiRefNet locally | $0 + your time | Free, open-source, runs on your own machine | At ~4 s per image on one CPU core, 500 images take roughly 30–40 minutes. The faster u2net model is 2–3× quicker for simple products on plain backgrounds, at the same price. The honest DIY alternative If you're comfortable with Python, you may not need any API: - rembg (MIT): pip install "rembg[cpu]", then rembg i in.jpg out.png. It ships the same open-source IS-Net and U2-Net models this actor uses, so on one laptop the quality is the same and it's free. - BiRefNet (MIT) is a newer model. It's often better on fine detail, but heavier, and much happier with a GPU. The hosted version is worth it when you don't want to maintain a Python environment, when the images are already URLs (supplier feeds, a Shopify export, a sheet), or when the job should run from Make, Zapier, n8n or a schedule. Where it struggles - Transparent and glass products (bottles, glasses, clear packaging). The model has to decide whether the background seen through the glass belongs to the product, and it often gets that wrong. remove.bg's proprietary model also tends to do better here. - Hair, fur and fluffy textiles come out softer than a manual mask. - White products on white or light-grey backgrounds have low contrast. In my test the white watches came out fine, but check edges on light-on-light shots. - Shadows are removed. The headphones lost their contact shadow. That's what Amazon's main image wants, but some brands prefer a soft shadow for secondary images. - It can't fix framing. One watch in the original runs off the edge of the photo, and it stays cut off. Amazon wants the whole product visible, so reshoot those. Always skim the batch before uploading. A contact sheet of thumbnails takes a minute and catches the few bad masks. Try it AI Background Remover on Apify: paste URLs in the console, or use the API calls above. The Apify free plan's monthly credit covers a few hundred test images.

    1 reaction
  6. 7) It cuts you out for thumbnails Rembg removes the background from any photo in one go, so you can drop yourself onto any thumbnail. danielgatis/rembg

    7 likes · 1 repost · 268 views
  7. Claude Code から呼べるローカル画像生成環境を作った(MCP + Docker + Apple Silicon) はじめに Claude は文章やコードは書けても、画像は生成できません。 ゲーム用のキャラクター画像を「ちょっと作ってほしい」と思ったときに、毎回別のサービスを開くのは面倒です。 そこで、ローカルの画像生成モデルを Claude Code からツールとして呼べる環境を作りました。 Claude Code に手伝ってもらいながら、Docker でも Mac でも Windows でも動くことを目標にしています。 tamoco-mocomoco/local-imagegen この記事では、作ったものと設計のポイント、途中でハマったところをまとめます。 作ったもの Claude Code に「子どもが喜びそうな猫のキャラを、差分込みで作って」と頼むと、こういう画像が出てきます。 左から基準・ジャンプ・おやすみ・おさかな。2〜4 枚目は 1 枚目を参照画像にして生成 同じ流れでクマも作りました。リボン、マフラー、毛色、目の描き方が揃っていて、同じキャラとして使えます。 ゲームのスプライト用に、背景を抜いた透過 PNG も出せます。 主な機能は次のとおりです。 HTTP API / Web UI / CLI / MCP サーバーの 4 つの入口 モデルの実行時切替。使うときに読み込んでキャッシュし、メモリに収まる分だけ常駐させる 同一キャラの差分生成(IP-Adapter) 背景除去で透過 PNG(rembg) 環境診断。マシンを調べて、使えるモデルと推奨設定を出す Docker イメージを GHCR で公開(amd64 は CUDA 版、arm64 は CPU 版) 全体の構成 中心は diffusers を使った FastAPI サーバーです。 CLI と MCP サーバーはどちらもこの HTTP API を呼ぶ薄いクライアントなので、生成の処理は 1 か所にまとまっています。 動作環境と実測値 手元の検証環境は MacBook Pro(M2 Max / 統合メモリ 64GB) です。 内容 設定 1 枚あたり ラフ sdxl-turbo / 512px / 4 steps 約 3 秒(常駐済みなら約 2 秒) アニメ調の仕上げ anime / 1024px / 28 steps 約 70〜77 秒 アニメ調のラフ anime / 768px / 8 steps 約 15 秒 参照画像あり anime / 1024px / 28 steps 約 70〜75 秒(初回のみアダプタ読み込み数秒) 背景除去あり anime / 1024px / 28 steps 生成時間 + 約 4 秒 Docker(CPU のみ) sdxl-turbo / 512px / 4 steps 約 67 秒 冒頭の猫(基準 1 枚 + 差分 3 枚 + 透過 1 枚)は、合計 6 分 31 秒でした。 メモリは、anime と sdxl-turbo を両方常駐させた状態で約 17GB です。 ディスクはモデル 1 つあたり約 7GB、IP-Adapter が約 3GB 必要です。 ! Linux + NVIDIA GPU と Windows は、手元に環境がないため未検証です。 設計上は動くようにしてあるので、試した方がいたら教えてもらえると嬉しいです。 設計のポイント 1. Mac は Docker ではなくネイティブで動かす 「どの環境でも動く」なら Docker が一番楽です。ただし、macOS の Docker は Apple Silicon の GPU(Metal)を使えません。 実測でも、同じ sdxl-turbo が Mac ネイティブだと約 3 秒、Docker の CPU 実行だと約 67 秒でした。 そこで起動方法を 2 本立てにしています。 環境 起動方法 Mac(Apple Silicon) ./run.sh または python3 run.py(ネイティブ、MPS で GPU 実行) Linux / Windows + NVIDIA GPU docker compose -f compose.yml -f compose.gpu.yml up -d GPU なし docker compose up -d(CPU) Windows ネイティブ python run.py ネイティブ起動は uv に任せています。Python のバージョンも依存関係も uv が揃えてくれるので、手順が「uv を入れて run.py を叩く」だけで済みます。 起動スクリプトは最初 run.sh と PowerShell 版の run.ps1 を用意していました。ただ、Windows 環境が手元になく PowerShell 側を検証できません。 そこで起動処理を Python 標準ライブラリだけで書いた run.py に一本化し、run.sh はそれを呼ぶだけにしました。環境変数の既定値と .env の読み込みもサーバー本体に寄せたので、どのシェルから起動しても同じ動きになります。 2. 用途でモデルを使い分ける モデルはプリセットとして登録しています。 プリセット モデル 用途 sdxl-turbo SDXL-Turbo 構図やプロンプトを試すラフ。数秒で出る anime Animagine XL 4.0 アニメ・ゲームキャラの仕上げ sdxl SDXL base 1.0 汎用の高画質 flux-schnell FLUX.1 schnell 写実・コンセプトアート(要 24GB 以上) zimage-turbo Z-Image-Turbo 日本語の文字入り画像 sd15 Stable Diffusion 1.5 CPU 向けの軽量版 ゲームキャラ用途では、ラフは sdxl-turbo か anime の 8 steps で数枚出して seed を選び、同じ seed で anime の 28 steps に上げて仕上げる流れが快適でした。 Animagine XL は Danbooru 形式のタグでプロンプトを書くと効きます。プリセット側で品質タグとネガティブプロンプトを自動で付けるようにしたので、使う側はキャラの特徴だけ書けば済みます。 python3 gen.py "1girl, solo, knight, silver armor, red cape, long orange hair, full body, white background" --preset anime 同じプロンプトでも、モデルによって絵柄がかなり変わります。 sdxl-turbo(512x512、4 steps) anime(832x1216、28 steps) 3. モデルは使うときに読み込んでキャッシュする 最初は起動時に 1 モデルだけ読み込む作りでした。これだと、ラフと仕上げでモデルを替えるたびにサーバーの再起動が必要です。 そこで、リクエストごとに preset を指定でき、未読み込みならその場で読み込んでキャッシュする形にしました。 常駐数の上限を超えたら、最も長く使っていないモデルから解放します(LRU)。 server/app.py(抜粋) def get(self, name: str) -> LoadedModel: m = self.models.get(name) if m is not None: m.last_used = time.time() return m self._evict_for(name) return self._load(name) def _evict_for(self, incoming: str) -> None: while len(self.models) >= MAX_LOADED_MODELS and self.models: victim = min(self.models.values(), key=lambda m: m.last_used) self._unload(victim.name) 常駐数の上限はメモリ容量から自動で決めています(32GB 以上なら 2、それ未満なら 1)。 実測では、キャッシュ済みモデルの読み込みが 10〜13 秒、常駐済みモデルへの切替は待ち時間ゼロでした。 4. 同一キャラの差分は IP-Adapter で作る ゲームでは同じキャラの表情違い・ポーズ違いが欲しくなります。 seed を固定してタグを揃えるだけでは、服の色や小物がずれがちです。 そこで IP-Adapter を使い、基準画像を参照として渡すようにしました。 1. 基準になる 1 枚 python3 gen.py "no humans, solo, cute bear mascot character, chibi, red scarf, waving, full body, white background" --seed 100 -o base.png 2. 基準を参照にして別ポーズ python3 gen.py "no humans, solo, cute bear mascot character, chibi, red scarf, sleeping, full body, white background" --ref base.png 参照の強さ(--ref-scale)は 0.6 を標準にしています。小物の色まで厳密に揃えたい場合は 0.7〜0.8 に上げるか、色をタグで明示すると安定します。 参照画像は CLIP が中央の正方形しか見ないので、縦長の立ち絵は白でパディングしてから渡しています。 5. 透過 PNG は rembg で後処理する 拡散モデルは透過画像を直接出せません。そこで生成後に rembg で背景を抜いています。 anime プリセットではアニメ絵向けの isnet-anime モデルを使うと、輪郭がきれいに抜けました。 プロンプトに simple background, white background を入れておくと、切り抜きの精度が上がります。足元の影まで消したいときは no shadow も足します。 6. MCP サーバーで Claude Code から呼べるようにする ここが今回の本題です。HTTP API を MCP のツールとしてラップしました。 mcp_server.py(抜粋・簡略化) from mcp.server.mcpserver import Image, MCPServer server = MCPServer("imagegen", instructions=_build_instructions()) @server.tool() def generate_image(prompt: str, preset: str | None = None, seed: int | None = None, remove_background: bool = False, reference_image_path: str | None = None, ...) -> list: """テキストから画像を生成して PNG を保存し、保存パスとプレビューを返す。""" ... 提供しているツールは次のとおりです。 ツール 内容 generate_image 画像を生成して保存。保存パスと 512px のプレビューを返す load_preset / unload_preset モデルの先読み・解放 list_presets / server_status プリセット一覧とサーバーの状態 diagnose 環境診断(後述) 工夫したのは、MCP の instructions を起動時に動的に作っている点です。 サーバーに問い合わせて「このマシンで選べるプリセット」「各プリセットの用途」「今読み込み済みのもの」を Claude に渡しています。 これにより、Claude 側が「ラフは sdxl-turbo、仕上げは anime」と自分で判断してモデルを選んでくれます。 登録は 1 行です。 claude mcp add imagegen -- "$PWD/.venv/bin/python" "$PWD/mcp_server.py" 7. 環境診断で初期設定を楽にする 配布するうえで一番つまずきやすいのは「自分の環境ではどのモデルが動くのか」です。 そこで、doctor.py で環境を診断するようにしました。こちらも Python 標準ライブラリだけで動きます。 $ python3 doctor.py --brief [doctor] macOS arm64 / Apple M2 Max / RAM 64GB / Apple Silicon 統合メモリ 64GB -> device=mps [doctor] 推奨: ./run.sh PRESET=anime MAX_LOADED_MODELS=2 [doctor] プリセット 推奨: sdxl-turbo, sd15, sdxl, anime, flux-schnell, zimage-turbo / 可: - / 不可: - GPU の種類とメモリ量、Docker や uv の有無、ディスクの空き、Hugging Face への回線速度、キャッシュ済みモデルを調べます。 そのうえで各プリセットを「推奨 / 条件付き / 不可」に分類し、推奨の .env を提示します。--write-env を付けたときだけ書き込みます。 同じ分類はサーバーの /presets にも出るので、MCP 経由の Claude も環境に合ったモデルを選べます。 8. Docker イメージは GitHub Actions で配布する Docker イメージは GitHub Actions でビルドして GHCR に公開しています。 linux/amd64 は ubuntu-24.04、linux/arm64 は ubuntu-24.04-arm のネイティブランナーでビルドし、最後にマルチアーキのマニフェストにまとめる amd64 は PyPI の torch をそのまま入れるので CUDA 同梱。NVIDIA GPU でも CPU でも動く torch のレイヤーが数 GB あるので、キャッシュは GHA キャッシュ(上限 10GB)ではなくレジストリキャッシュを使う イメージにモデルの重みは含めていません。初回起動時に各自が Hugging Face から取得します。 ハマったところ Hugging Face のダウンロードが 0 B/s で止まる 最初のモデル取得が 1GB ほどで止まり、転送速度が 0 のまま動かなくなりました。 ログを見ると、Hugging Face の新しい転送方式(hf-xet)の並列接続が詰まっていました。 HF_HUB_DISABLE_XET=1 で通常の HTTPS ダウンロードに切り替えたところ、約 13MB/s で流れるようになりました。 環境によって相性がありそうなので、このリポジトリでは無効化を既定にしています。 IP-Adapter の読み込みが attention slicing と衝突する Mac(MPS)ではメモリ節約のために enable_attention_slicing() を有効にしていました。 この状態で IP-Adapter を読み込むと、次のエラーで失敗します。 TypeError: SlicedAttnProcessor.init() missing 1 required positional argument: 'slice_size' IP-Adapter は attention processor を差し替えるため、slicing 用の processor と両立しないようです。 アダプタを載せている間だけ slicing を切り、外したら戻すようにして解決しました。 server/app.py(抜粋) attention slicing が有効だと IP-Adapter の attention processor 差し替えに失敗する self._set_attention_slicing(m, False) try: m.pipe.load_ip_adapter(...) except Exception: m.pipe.unload_ip_adapter() self._set_attention_slicing(m, True) raise MCP の Python SDK 2.x で API が変わっていた pip install mcp で入ったのが 2.x 系で、1.x の FastMCP が MCPServer に改名されていました。 1.x from mcp.server.fastmcp import FastMCP, Image 2.x from mcp.server.mcpserver import MCPServer, Image クライアント側の結果オブジェクトも isError が is_error、mimeType が mime_type のように snake_case になっています。 ネットの記事は 1.x 前提のものが多いので注意が必要です。今回は両方に対応するよう import を分岐させました。 プロンプトのクセ アニメ系モデルでいくつか気づいたことがあります。 1 人だけ描かせたいときは solo を入れる。入れないと背景に別のキャラが混ざることがある 動物のマスコットは no humans, solo, mascot character, chibi から書き始めると安定する soft pastel colors を入れると、white background を指定していても背景が薄紫に寄る 「耳にリボン」のような小物の位置指定は弱い。こだわるなら seed を変えて数枚から選ぶ ライセンスについて このリポジトリのコードは MIT ライセンスです。モデルの重みは同梱しておらず、各ユーザーが Hugging Face から取得します。 プリセット ライセンス 商用利用 anime / sdxl / sd15 CreativeML Open RAIL 系 可(禁止用途の制限あり) flux-schnell / zimage-turbo Apache-2.0 可 IP-Adapter / rembg Apache-2.0 / MIT 可 sdxl-turbo Stability AI Community License 年商 100 万ドル未満のみ無償 ! 商用で使う場合は、各モデルのライセンス本文を必ず確認してください。 特に sdxl-turbo は年商条件があります。また、既存の作品名やキャラクター名をプロンプトに入れると酷似した絵が出ることがあるので、商用素材では避けるのが無難です。 使ってみる Mac / Linux の場合はこうです。 git clone tamoco-mocomoco/local-imagegen && cd local-imagegen python3 doctor.py --write-env # 環境を診断して推奨の .env を書く ./run.sh # 初回は依存の取得とモデルのダウンロード python3 gen.py "1girl, solo, knight, full body, white background" -o knight.png Docker の場合は、公開イメージを取得して起動します。 docker compose up -d # CPU docker compose -f compose.yml -f compose.gpu.yml up -d # NVIDIA GPU Windows は python run.py で起動できます。 おわりに Claude が画像を作れない部分を、ローカルの画像生成モデルで補う環境を作りました。 MCP でつなぐと「キャラを作って、差分も 3 枚、背景は透過で」と頼むだけで、モデル選びから保存まで Claude 側で進めてくれます。 M2 Max だと仕上げ品質の 1 枚に 1 分強かかりますが、ラフを数秒で回して良い seed だけ仕上げれば、実用的な待ち時間に収まりました。 ローカルなので、生成枚数を気にせず試行錯誤できるのも良いところです。 リポジトリは MIT で公開しています。Issue や PR、動作報告をお待ちしています。 tamoco-mocomoco/local-imagegen

  8. 一批图片要去背景,可以用 rembg 在本地处理。 按仓库说明装好 CPU 版 CLI 后: rembg p input output 把 input、output 换成输入和输出文件夹。 需 Python 3.11–3.13,首次会下载模型;先检查边缘再跑整批。商用需另查模型许可,默认 BRIA 模型要求付费商用协议。 项目:danielgatis/rembg

    7 views
  9. 画像背景処理・自動除去ツールの決定版比較!エンジニア視点で選ぶ最適解と現場の活用法 Web開発やECサイトの構築、技術ブログのアイキャッチ作成など、日々のエンジニアリング業務の中で「画像から背景だけを綺麗に切り抜きたい」という場面は意外と頻繁に発生します。 CLIツールでバッチ処理を組むべきか、Cloud APIを叩くべきか、あるいはWebブラウザ上で完結させるべきか——。現場のパフォーマンスや開発効率に直結するからこそ、ツールの選定基準は明確にしておきたいところです。 今回は、日々の開発やブログ執筆で背景処理ツールを活用している筆者が、画像背景除去・背景変更の手法やツールの比較と、実践的な活用ナレッジを共有します。 画像背景除去アプローチの3大分類と選定基準 エンジニアが背景処理ツールを検討する際、大きく分けて3つの選択肢が存在します。それぞれのメリット・デメリットを整理してみましょう。 アプローチ 主な手法・ツール メリット デメリット 1. ローカル / CLI Rembg (Python / ONNX), OpenCV 無料・完全オフライン処理・バッチ処理に最適 環境構築が必要、エッジ検出の精度設計が手動 2. API連携 remove.bgAPI, Cloud Vision API 高精度・バックエンド処理へ組み込み易い クレジット制によるコスト増、APIキーの管理 3. Webツール / ブラウザ完結 WebAssembly系ツール, オンラインエディタ インストール不要・UI操作・即座に確認可能 大量一括処理には不向き(ブラウザ仕様に依存) 技術選定のチェックポイント 処理精度(透過境界のクオリティ): 髪の毛や透過素材(グラスなど)の認識精度 処理速度 & レスポンス: 数十〜数百枚の処理にかかるレスポンスタイム データプライバシー: セキュリティ要件上、外部サーバーへデータを送信可能か プログラマブルに大量画像をパイプライン処理する場合は Python の Rembg(U-2-Netモデルベース)などをローカルで回すのが定番ですが、デザインチームとの連携や「今すぐ数枚だけ手軽に高品質な透過画像を作りたい」という局面では、ブラウザで完結するWebユーティリティが非常に強力です。 現場で使って分かった主要手法の徹底比較 それぞれの日常業務での使い勝手を比較してみます。 1. Rembg(オープンソース / CLI・Python) 使い勝手: ★★★★☆ 精度: ★★★★☆ 特徴: PyPIから一発でインストール可能。バックエンドのバッチ処理やDockerコンテナ内での画像前処理に最適です。複雑な背景でも精度高く被写体を抽出できますが、モデルファイルのロードに若干のメモリ領域を食います。 2. remove.bg(SaaS / API) 使い勝手: ★★★★★ 精度: ★★★★★ 特徴: 切り抜き精度に関しては業界トップクラスです。開発者用APIも洗練されており、Webhook連携なども容易。ただし無料枠を超えると従量課金となるため、コスト管理が必要です。 3. ブラウザベースの軽量Webユーティリティ 使い勝手: ★★★★★ 精度: ★★★★☆ 特徴: インストールやAPIキーの発行すら面倒なちょっとした作業に威力を発揮します。最近はWasm(WebAssembly)を活用してクライアントサイドで高速処理を行うものも増えています。 効率的なワークフローの組み方と実例 私の場合、技術ブログのグラフィック素材作成やプロトタイプ開発では、以下のように使い分けています。 自動化・バッチ処理: PythonスクリプトでRembgを読み込み、CI/CDやデータパイプライン内で自動生成 個別カスタマイズ・クイック編集: Webブラウザ上で背景透過・カラー差し替えを一元処理 例えば、プロダクトの仕様書用画像やアイコン素材を作成する際、単純に背景を透明にするだけでなく「特定の指定色(#FFFFFFや単色グラデーション)に変更したい」というニーズがよくあります。 わざわざPhotoshopやFigmaを立ち上げるまでもない軽微な修正であれば、画像背景を変更できるWebツール などを使ってブラウザ上でパパッと背景色を透過・置換してしまうのが最も手軽でタイムパフォーマンスが高いと感じています。 まとめ 画像の背景処理は、用途と運用スケールに合わせて最適なツールを選択するのが鉄則です。 システム組み込み・大量処理 \rightarrow Rembg などのオープンソースライブラリや各種 Cloud API 単発作業・デザイン調整・アイキャッチ作成 \rightarrow オンラインの背景透過・変更ユーティリティ ツール選びの引き出しを増やしておくことで、日常のちょっとした作業ストレスを大幅に軽減できます。ぜひ自分の開発スタイルに合ったベストな組み合わせを試してみてください!

  10. YouTube · · YouTube description · GitHub Repos You Should Know · danielgatis/rembg

    Remove Photo Backgrounds Locally with rembg | GitHub Repos You Should Know #013 Remove a photo background without uploading the photo. Repo: danielgatis/rembg Classification: Worth Knowing We tested rembg 2.0.85 locally on the CPU with the explicitly selected U2Net model. Actual transparent PNG outputs and single-image/folder CLI tests were retained. Python outbound connections were blocked during the inference tests after downloading the model. The opening wipe is an editorial comparison, not a processing-speed benchmark. Commands shown: rembg i -m u2net photo.png cutout.png rembg p -m u2net input/ output/ Inspect edges and fine details. These are raw model outputs, not manually retouched masks. The portrait showcase uses the same head-and-shoulders crop on the source and output; the hair close-up uses matching crops too. Licences: rembg MIT; selected U2Net upstream Apache-2.0. Other models can have different restrictions. No BRIA model or cloud inference was used. github.com/danielgatis/rembg/blob/main/LICENSE.txt xuebinqin/U-2-Net Image sources: coffee by Rachel Michetti, CC0 via scikit-image; NASA publicity portrait of Eileen Collins, public domain via scikit-image. No endorsement implied. scikit-image.org What would you cut out? #GitHub #OpenSource #rembg

    10 likes · 2 comments · 1,311 views
Trending awards, every completed day and week
Gold
01st place finishes
Silver
02nd place finishes
Bronze
03rd place finishes
Awarded repositories
0Owned by danielgatis now

No trending awards yet

None of the repositories danielgatis owns has finished in the top three of a completed trending day or week, by stars, forks or PR authors. See who is trending now.

A repository earns an award for finishing first, second or third in a completed trending day or week, ranked by new stars, new forks or pull request authors. Awards follow a repository through renames and transfers and count toward its current owner. Weeks run Monday to Sunday, UTC.