メインコンテンツへスキップ

画像の切り抜き n8n アクション

PDF4me 画像の切り抜き 正確な画像領域を抽出する n8n 自動化ワークフロー。画像を処理 n8n トリガー、バイナリデータ、base64文字列、または公開 URL境界線削除(左/右/上/下から削除するピクセルを指定)または矩形選択(座標と寸法を定義)を使用して、画質を維持したまま柔軟なトリミングを行うことができます。このソリューションは、画像編集、境界線削除、コンテンツのフォーカス調整、サムネイル作成、Web最適化、ソーシャルメディアの準備、およびプロフェッショナルな出力とシームレスな統合による正確な領域選択を必要とする自動トリミングワークフローに最適です。

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

設定​

追加する PDF4me 「画像の切り抜き」ノードを n8n ワークフローを実行し、必要なパラメータを設定します。初期設定手順については、こちらをご覧ください。 n8n 統合ガイド。

前提条件:

  • PDF4me API 資格
  • n8n ワークフローへのアクセス

構成:

  1. 追加 PDF4me ノードからワークフローへ
  2. 「画像の切り抜き」アクションを選択します。
  3. 入力パラメータを設定します(下記参照)。
画像の切り抜き

パラメータ​

画像切り抜きアクションのパラメータ一覧です。これらのパラメータを設定することで、画像の切り抜きを制御できます。

重要: アスタリスク(***)が付いているパラメータは必須であり、アクションが正しく機能するためには必ず指定する必要があります。

パラメータ必須その機能例
Input Data TypeRequiredChoose how to provide the image file to crop. Options: Binary Data, Base64 String, URL. Default is `Binary Data`.Binary Data
Input Binary FieldConditionalName of the binary property that contains the image file. Shown when Input Data Type is Binary Data. Default is `data`.data
Base64 Image ContentConditionalBase64 encoded image content. Shown when Input Data Type is Base64 String./9j/4AA...
Image URLConditionalURL to the image file to crop. Shown when Input Data Type is URL.https://abc.com/demo.jpg
Output File NameOptionalName for the output cropped image file. Default is `cropped_image.jpg`.cropped_image.jpg
Document NameOptionalName of the source image file for reference. Default is `image.jpg`.image.jpg
Crop TypeOptionalType of cropping to perform. Options: Border, Rectangle. Default is `Border`.Border
Border Cropping OptionsConditionalOptional settings, collapsed behind Add Option.Add Option
Left BorderOptionalNumber of pixels to crop from the left border. Default is `10`.10
Right BorderOptionalNumber of pixels to crop from the right border. Default is `10`.10
Top BorderOptionalNumber of pixels to crop from the top border. Default is `20`.20
Bottom BorderOptionalNumber of pixels to crop from the bottom border. Default is `20`.20
Rectangle Cropping OptionsConditionalOptional settings, collapsed behind Add Option.Add Option
Upper Left XOptionalX coordinate of the upper left corner of the crop rectangle. Default is `10`.10
Upper Left YOptionalY coordinate of the upper left corner of the crop rectangle. Default is `10`.10
WidthOptionalWidth of the crop rectangle in pixels. Default is `50`.50
HeightOptionalHeight of the crop rectangle in pixels. Default is `50`.50
Output Binary Field NameOptionalName of the binary property to store the output image file. Default is `data`.data
Advanced OptionsOptionalOptional settings, collapsed behind Add Option.Add Option
Custom ProfilesOptionalUse "JSON" to adjust custom properties. Review Profiles at https://developer.pdf4me.com/api/profiles/index.html to set extra options for API calls.{ 'outputDataFormat': 'base64' }

出力​

出力パラメータ​

分野タイプ内容物
fileNameStringOutput File Name; when it has no extension, the extension of the input image is added.
mimeTypeStringMIME type from the output file name extension, for example `image/jpeg` (`image/jpeg` when unknown).
fileSizeNumberSize of the resulting file in bytes.
successBooleanTrue when the operation succeeded.
cropTypeStringCrop Type that was used (Border or Rectangle).
originalFileNameStringName of the input image (for Base64 input, the Document Name field).
messageStringStatus message, `Image cropped successfully`.
dataBinaryThe cropped image.

N8N 行動対応​

の PDF4me 画像の切り抜き API 複数の形式で表示可能なレスポンスを返します。ニーズに最適な表示形式を選択してください。

JSON 回答形式

生 JSON からの応答 API:

[
{
"success": true,
"message": "Image cropped successfully",
"fileName": "cropped_image.jpg",
"mimeType": "image/jpeg",
"fileSize": 125430,
"originalFileSize": 245760,
"cropDimensions": {
"width": 800,
"height": 600,
"x": 100,
"y": 50
}
}
]

ユースケース​

コンテンツマーケティングとソーシャルメディア​

  • 商品画像をトリミングして主要な特徴に焦点を当て、視覚的な魅力を向上させます。
  • さまざまなソーシャルメディアプラットフォーム向けに、特定の縦横比に合わせて画像を最適化します。
  • マーケティング資料から不要な背景や枠線を削除する

Eコマースと製品管理​

  • オンラインカタログ全体で製品画像のサイズを標準化する
  • 商品写真から透かしや不要な要素を削除する
  • 商品リスト用に一貫性のあるサムネイル画像を作成する

文書および画像処理​

  • スキャンした文書から枠線と余白を削除する
  • 特定のインターフェース要素に焦点を当てるためにスクリーンショットをトリミングする
  • 不要な領域を削除して、ウェブ表示用に画像を最適化します。

ヘルプが必要な場合​