Google「ImageFX」と「ChatGPT」を活用した、ビジュアル生成と画像最適化の実践

  • X
  • Facebook
  • note
  • hatena
  • Pocket

2. ChatGPTによる画像内容の最適化

 ChatGPTは、テキスト生成だけでなく画像の内容に関する理解を深め、ビジュアルやデザインに必要な文脈を提供してくれます。たとえば、ChatGPTに画像に関連する説明を求めることで、画像やデザインの意図、背景、ユーザーインターフェース内での役割を明確にすることができます。

プロンプトエンジニアリングの新たなアプローチ

 早速、GPTに画像の要素を詳細に分析してもらいます。最適なプロンプトを生成するための、具体的なワークフローは次のとおりです。

  1. 元素材をアップし抽出したい要素をまとめ、質問をする
  2. ChatGPTが画像の詳細な要素を分析確認
  3. ImageFX用の最適化されたプロンプトを生成
  4. プロンプトの確認と必要であれば微調整

 以下のイメージに近い画像を生成するため元素材をアップし、生成用のプロンプトをChatGPTに抽出してもらいます。

筆者撮影画像
筆者撮影画像

「アップした画像と同じ写真を生成AIで作りたいので、そのためのプロンプトを生成してください。画像要素だけでなく、撮影カメラレンズの口径とF値、露出や光量や光の向き、視点や高さとレイアウト、ボケ具合、ホワイトバランス、撮影時の条件も推察してプロンプトを教えてください。」

 GPTが提供してくれた画像のプロンプトは以下になりました。

"A cozy breakfast scene featuring a rustic table setup placed on a pair of blue barrels with a natural wood finish. On the table, there is a white ceramic mug filled with black coffee and a plate with a sausage wrapped in a soft tortilla, topped with crispy fried onions and garnished with fresh dill. The lighting is soft and natural, coming from the side, creating gentle shadows and enhancing the textures of the food. The background is minimal with a light teal color and a wooden chair in the distance, slightly blurred. The depth of field is shallow, with the food in sharp focus and the barrels and background softly out of focus. Warm tones dominate the image, creating a comforting and inviting atmosphere. The scene is shot from a slightly elevated, diagonal angle to highlight the details of the food and the rustic setup."

 これをimageFXに入力して、画像を生成してみます。

 視点は少し違いますが、かなり精度の高い画像が生成されましたね。色彩やボケ具合、ローズマリーも表現されています。人物の写った別の画像でもう一枚生成してみます。

 人物はわたしです。地元の海で撮影しました。またこれをGPTに投げて、要素をプロンプトにしてもらいます。

A serene coastal scene at sunset featuring a man standing on a concrete pier overlooking a calm sea. The man, dressed in a black jacket, grey loose-fit trousers, and dark shoes, waves his hand casually while looking toward the camera. Behind him, the horizon showcases a layered mountain range fading into the distance and the expansive ocean under a gradient sky transitioning from soft yellows to cool blues. The light is natural and diffused, coming from the horizon, creating a soft glow on the subject and subtle shadows on the pier. The composition captures the man slightly off-center to the right, with the pier leading diagonally into the scene, emphasizing depth and perspective. The background mountains and ocean are slightly out of focus, achieved with a shallow depth of field.

 再びプロンプトをImageFXに入力すると、以下の画像が生成されました。顔は違いますが、かなり元画像の要素を取り入れた精度の高いイメージ画像が生成できました。

 GPTが教えてくれたプロンプトを簡単に翻訳すると次のようになります。

穏やかな海を見下ろすコンクリートの桟橋に立つ男をフィーチャーした、夕暮れ時の穏やかな海岸風景。黒いジャケットにグレーのゆったりとしたズボン、ダークカラーの靴を履いた男は、カメラの方を見ながらさりげなく手を振っている。彼の背後には、水平線が幾重にも重なり、遠ざかる山並みと、柔らかな黄色から涼しげな青へと移り変わるグラデーションの空の下に広がる海を映し出している。光は水平線からの自然な拡散光で、被写体を柔らかく照らし、桟橋に微妙な影を作っている。構図は、人物をやや右寄りの中心から外し、桟橋を斜めに入れることで、奥行きと遠近感を強調している。背景の山と海は、被写界深度を浅くすることでわずかにボケている。

 元画像からこれだけの要素を一瞬で抽出してくれて、全体の雰囲気から光量、被写界深度にも触れている点が高い精度につながっていると思います。現時点では無料でできるのでぜひ試してみてください。やってみると、本当におもしろいです。

エクスプレッシブチップス機能について

 生成された画像に活用したプロンプトの一部をレコメンド、かつドロップダウン化してくれ、そのプロンプトに関連する単語の候補を提示します。

 たとえば上の画像のように、ジャケットの別カラーを提案してくれます。そのほかには、空や光の種類、風景の特徴などさまざまな要素を簡単に変更できます。選択肢の中から「ジャケットを赤」「山の木々を増やす」「空をドラマチック」を選択してみると瞬時に以下のような編集を加え、生成し直してくれました。