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?

GPT5.2を用いてExcelでピクセルアートつくーる

Posted at

はじめに

GPT5.2では、Excelでピクセルアートが作れるみたいなので、試してみました。

開発環境

  • ChatGPT
  • Claude
  • Gemini

導入

ChatGPT

ChatGPTを開いて次のメッセージを入力してください

💬 セルの塗りつぶしによってsnowmanのピクセルアートを生成してexcelファイルとしてちょうだい
20251225-072311-6327d706.png

Claude

ちなみにClaude Sonnet 4.5 はアーティファクトには表示されているのですが、ダウンロードしたら表示されませんでした

20251225-072819-62b4c218.png

20251225-072728-14efd431.png

Gemini

GeminiではApps Scriptで作ってくれました

💬 セルの塗りつぶしによってsnowmanのピクセルアートを生成してスプレッドシートとしてちょうだい

作成手順

  1. Google スプレッドシートを新規作成します。
  2. メニューの [拡張機能] > [Apps Script] をクリックします。
  3. もともと書いてあるコードをすべて消して、以下のコードを貼り付けます。
  4. [保存(フロッピーアイコン)] を押し、[実行] をクリックします。
  5. スプレッドシートに戻ると、雪だるまが出現しています!
.gs
function createSnowmanPixelArt() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  
  // シートをリセット(列の幅と行の高さを正方形にする)
  sheet.clear();
  sheet.columnStats = sheet.getMaxColumns();
  for (let i = 1; i <= 20; i++) {
    sheet.setColumnWidth(i, 25);
    sheet.setRowHeight(i, 25);
  }

  // カラーコードの定義
  const W = "#FFFFFF"; // 白
  const B = "#000000"; // 黒
  const O = "#FFA500"; // オレンジ(鼻)
  const R = "#FF0000"; // 赤(マフラー)
  const BG = "#87CEEB"; // 水色(背景)

  // 15x15のピクセルデータ
  const data = [
    [BG, BG, BG, BG, BG, BG, BG, BG, BG, BG, BG, BG, BG, BG, BG],
    [BG, BG, BG, BG, BG, B, B, B, B, B, BG, BG, BG, BG, BG],
    [BG, BG, BG, BG, BG, B, B, B, B, B, BG, BG, BG, BG, BG],
    [BG, BG, BG, B, B, B, B, B, B, B, B, B, BG, BG, BG],
    [BG, BG, B, W, W, W, W, W, W, W, W, W, B, BG, BG],
    [BG, BG, B, W, B, W, W, W, B, W, W, W, B, BG, BG],
    [BG, BG, B, W, W, W, O, O, W, W, W, W, B, BG, BG],
    [BG, BG, B, W, W, W, W, W, W, W, W, W, B, BG, BG],
    [BG, BG, BG, B, W, W, W, W, W, W, W, B, BG, BG, BG],
    [BG, BG, B, R, R, R, R, R, R, R, R, R, B, BG, BG],
    [BG, B, W, W, W, W, W, W, W, W, W, W, W, B, BG],
    [BG, B, W, W, W, W, B, W, W, W, W, W, W, B, BG],
    [BG, B, W, W, W, W, W, W, W, W, W, W, W, B, BG],
    [BG, B, W, W, W, W, B, W, W, W, W, W, W, B, BG],
    [BG, BG, B, B, B, B, B, B, B, B, B, B, B, BG, BG]
  ];

  // セルに色を適用
  for (let r = 0; r < data.length; r++) {
    for (let c = 0; c < data[r].length; c++) {
      sheet.getRange(r + 1, c + 1).setBackground(data[r][c]);
    }
  }
}

20251225-073139-e54eabea.png

ChatGPT Claude Gemini
20251225-072311-6327d706.png 20251225-073555-5315b537.png 20251225-073139-e54eabea.png

お疲れ様でした

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?