Back to Node List

Content Bounds

content_bounds

Measure the occupied pixel bounds and transparent margins without changing the image

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
画像
input
Image
Required
描画範囲と透明余白を測る画像です

Output Ports

NameTypeDescription
X
x
Int
有効範囲の左端です。CropのXへ接続できます
Y
y
Int
有効範囲の上端です。CropのYへ接続できます
width
Int
有効範囲の幅です。空画像でも後段を壊さない1を返します
高さ
height
Int
有効範囲の高さです。空画像でも後段を壊さない1を返します
元の幅
original_width
Int
入力画像全体の幅です
元の高さ
original_height
Int
入力画像全体の高さです
左余白
margin_left
Int
有効範囲より左にある余白のピクセル数です
上余白
margin_top
Int
有効範囲より上にある余白のピクセル数です
右余白
margin_right
Int
有効範囲より右にある余白のピクセル数です
下余白
margin_bottom
Int
有効範囲より下にある余白のピクセル数です
空画像
is_empty
Bool
条件を満たす画素が1つもない時にtrueです。空フレームの分岐に使います

Parameters

NameTypeDefaultRangeDescription / Options
アルファしきい値
alpha_threshold
Float
0.010–1 / step 0.01

この透明度以上を描画ありと数えます。0で少しでも見える画素、0.01前後で薄いアンチエイリアスも含め、0.5前後で柔らかい影や光を余白から外すのが目安です

透明RGBも含める
include_transparent_rgb
Bool
false

完全透明でもRGBが残る画素を範囲に含めます。透過境界の色や補間用の隠れ色を検査する時だけONにします

Overview

Reports the X, Y, width, and height of visible content without modifying the image. Use it to inspect padding before atlas packing, detect empty animation frames, or crop while retaining the original origin.

Usage tips

  • For automatic cropping, connect image → content_bounds → crop. Connect the source image directly to crop.input, and wire x, y, width, and height to the matching promoted crop parameters.
  • Start with an alpha threshold of 00.01 for ordinary pixel art. Raise it to about 0.250.5 only when soft shadows or glow make the bounds too large.
  • Include Transparent RGB is an inspection option for assets that intentionally preserve color in fully transparent pixels. Leave it off for normal appearance-based cropping.
  • Even when is_empty=true, width and height are 1. This safe value prevents a zero-size error downstream; use is_empty as the branch condition when empty frames must be removed.

Common mistakes

  • Shadows or glow are included: raise the alpha threshold slightly. If the outline is clipped, the value is too high.
  • An invisible image reports the full canvas: check whether Include Transparent RGB is on.
  • Animation placement jitters: cropping every frame independently changes its origin. Use one union bound for all frames or store X/Y in the export manifest.

Related nodes

  • crop — crop to the measured rectangle
  • canvas_resize — place the cropped result back on a fixed canvas
  • region_info — measure area and center for each existing Region instead of the whole image
Back to Node List
Content Bounds — PixPipeline Node Reference