0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【ChatGPT+Code Interpreter】で文章をワード単位で出すアニメGIFです。

Posted at

 どうも、カーブミラーです。

 今回は、文章をワード単位で出すアニメGIFです

本記事は、ChatGPT(有料版)
で行なっております。画像は
あります。 あしからず。

 まずは、ニュース。

 OpenAIから。

 なんと、
  無料版に
   DALL-E3を
    二枚だけ開放。

 二枚だけって……
  五枚くらい開放しようよ😅

 OpenAI公式ポスト


 次のニュース。

 先日、
  ChatGPT で
   Code Interpreterを
    使用した際に、
     ダウンロードリンクが
      出ない不具合について。

 さきほど
  直ったのが
   確認できました。

 よかった😅


 さて、本題です。

 今回は、
  文章をワード単位で出す
   アニメGIFです。

 よくテロップで、
  音声を出すときに
   ワード単位で出てくる
    ものがありますよね。
     アレを擬似的に
      やっています。

 出来上がりはこちら。
animated_text (2).gif

 Promptがこちらです。

# CodeInterpreterで文字列処理

### 初期設定
1. 画像のサイズ: `width = 512`, `height = 512`
2. 背景色: `bg_color = (255, 255, 255)` (白)
3. テキスト: `text = "I am a ChatGPT."`
4. テキストの色: `text_color = (0, 0, 0)` (黒)
5. フォントサイズ: `font_size = 48`
6. フォントパス: `font_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"`
7. フレーム数: `frames = 60` (1秒あたり30フレーム)

### 注意事項
コード不要。
確実に実行せよ。

### 処理内容
1. 白い正方形画像を作成する。
2. 画像中央にテキストを描画する。
3. [テキストがワード単位で0.5秒間隔で出てくる]アニメーションGIFを作成する。
    - 各フレームにおけるテキストの位置を計算して配置する (`x`, `y`)
4. GIFを保存する (`gif_path`).

 3. [テキストがワード単位で0.5秒間隔で出てくる]

 この部分が
  やりたいことの指示に
   なります。

 みなさんの
  作品制作の糧に
   なれば、幸いです。

 今回は、ここまで。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?