一部の画像のサイズを小さくするために、一部の画像の白いパディングを削除したいと思います。境界線に大きな白い領域がある場合は、それらをトリミングしてスペースを節約できるという考え方です。
何か案が?
を使用してトリミング境界線を取得しました
Dim MinX As Integer = W : Dim MaxX As Integer = 0
Dim MinY As Integer = H : Dim MaxY As Integer = 0
Dim White As Integer = Color.White.ToArgb()
For x As Integer = 0 To W - 1
For y As Integer = 0 To H - 1
If Not Output.GetPixel(x, y).ToArgb() = White Then
MinX = Math.Min(MinX, x)
MaxX = Math.Max(MaxX, x)
MinY = Math.Min(MinY, y)
MaxY = Math.Max(MaxY, y)
End If
Next
Next