Ticket #43495

アイコンをBMPからPNGに変更

Date d'ouverture: 2021-12-29 01:59 Dernière mise à jour: 2023-01-19 00:42

Rapporteur:
Propriétaire:
Type:
État:
Atteints
Composant:
(Aucun)
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
1
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

Trea Term 5 では Visual Studio 2019 以上を使うことになったので、PNGアイコンを使えるようになった。

  • Visual Studio 2008 以降でPNGアイコンが使用可能 cf.wiki:アイコン
  • PNGアイコンにするとファイルサイズの節約になる

  • 新しいアイコン
    • teraterm\common\teraterm.ico
    • teraterm\common\vt.ico
    • ttpmacro\ttmacro.ico
    • ttpmacro\ttmacrof.ico
    • ttssh2\ttxssh\ttsecure.ico
  • 格納されている過去のアイコン
    • teraterm\common\teraterm_3d.ico
    • teraterm\common\teraterm_flat.ico
    • teraterm\common\vt_3d.ico
    • teraterm\common\vt_flat.ico
    • ttpmacro\ttmacro_3d.ico
    • ttpmacro\ttmacro_flat.ico
    • ttssh2\ttxssh\ttsecure_yellow.ico
    • ttssh2\ttxssh\ttsecure_green.ico
    • ttssh2\ttxssh\ttsecure_flat.ico
  • 256pxアイコンを含まずファイルサイズの大きくないアイコンは、いったん対応しない
    • teraterm\keycode\keycode.ico
    • ttssh2\ttsecure_classic.ico
    • ttpmenu\teraterm.ico
    • cygwin\cygterm\cygterm.ico

Ticket History (3/11 Histories)

2021-12-29 01:59 Updated by: nmaya
  • New Ticket "アイコンをBMPからPNGに変更" created
2022-02-10 00:23 Updated by: nmaya
  • Details Updated
2022-02-10 00:33 Updated by: nmaya
  • Details Updated
2023-01-11 08:33 Updated by: nmaya
  • Details Updated
2023-01-12 00:31 Updated by: nmaya
Commentaire

PNG アイコンの作成が難しそうです。

  • 既存のファイルを、順番を指定してマルチアイコンとして保存できるツールが少ない
  • @icon変換
    • BMP マルチアイコンなら問題ないが、PNG のマルチアイコンとして保存すると...
      • 出力されたアイコンファイルは、指定した全ての画像を含んでいる
      • アイコンファイルのプロパティを見ると 32px と表示される
        • Visual Studio で新規作成したプロジェクトに含まれるアイコンでも同じ現象なので、問題ないと思われる
      • exe に組み込むと 256px アイコンが含まれていない(48pxまではある)
        • @icon変換で見えないだけで、exe には含まれている様子なので問題なさそう
  • icotool
    • 元 PNG 画像のアルファチャンネルが正しく反映されない(半透明のドットを完全に透明なドットとして扱っていそう)
    • (ファイルサイズからすると)BMP マルチアイコンになっていて、PNG マルチアイコンにならない
(Edited, 2023-01-12 12:34 Updated by: nmaya)
2023-01-17 22:38 Updated by: nmaya
  • État Update from Ouvert to Atteints
  • Propriétaire Update from (Aucun) to nmaya
  • Résolution Update from Aucun to Fixed
Commentaire

r10506 で対応しました。

2023-01-17 22:47 Updated by: zmatsuo
  • État Update from Atteints to Ouvert
  • Propriétaire Update from nmaya to (Aucun)
  • Résolution Update from Fixed to Aucun
Commentaire

icotool を使ってアイコンファイルを再作成してみました。

r10503 の teraterm\common\teraterm.ico 286550 byte を

icotool.exe -l teraterm.ico
--icon --index=1 --width=32 --height=32 --bit-depth=4 --palette-size=16 --type=bmp
--icon --index=2 --width=16 --height=16 --bit-depth=4 --palette-size=16 --type=bmp
--icon --index=3 --width=256 --height=256 --bit-depth=32 --palette-size=0 --type=bmp
--icon --index=4 --width=48 --height=48 --bit-depth=32 --palette-size=0 --type=bmp
--icon --index=5 --width=32 --height=32 --bit-depth=32 --palette-size=0 --type=bmp
--icon --index=6 --width=16 --height=16 --bit-depth=32 --palette-size=0 --type=bmp

手元で icotools -x したのち、

icotool -c teraterm_1_32x32x4.png teraterm_2_16x16x4.png -r teraterm_3_256x256x32.png teraterm_4_48x48x32.png teraterm_5_32x32x32.png teraterm_6_16x16x32.png > teraterm.ico
(-r オプションとファイルの並び順が重要) teraterm.ico 27025 byte

icotool.exe -l teraterm.ico
--icon --index=1 --width=32 --height=32 --bit-depth=4 --palette-size=16 --type=bmp
--icon --index=2 --width=16 --height=16 --bit-depth=4 --palette-size=16 --type=bmp
--icon --index=3 --width=256 --height=256 --bit-depth=32 --palette-size=0 --type=png
--icon --index=4 --width=48 --height=48 --bit-depth=32 --palette-size=0 --type=bmp
--icon --index=5 --width=32 --height=32 --bit-depth=32 --palette-size=0 --type=bmp
--icon --index=6 --width=16 --height=16 --bit-depth=32 --palette-size=0 --type=bmp

ttermpro.exe のアイコンを見た感じ、うまくいっているように見えます。 作成したteraterm.icoを添付します。

(Edited, 2023-01-17 22:49 Updated by: zmatsuo)
2023-01-18 07:26 Updated by: nmaya
  • État Update from Ouvert to Atteints
  • Propriétaire Update from (Aucun) to nmaya
  • Résolution Update from Aucun to Fixed
Commentaire

確認ありがとうございます。この -r というオプションは man には見つからなかったんですが、存在するんですね。


4bit アイコンは編集ツール(Photoshop)の都合でこのような流れで作っています。

  • Phtoshop: 透過色を #ff00ff で塗る
  • Phtoshop: 保存(psd -> 4bit bmp)4bit png で保存できないため
  • Edge: 4bit bmp を開き、4bit png としてエクスポート

Photoshop がなく psd へのバックポートを考慮せずにアイコンを編集するには、

  • 4bit png で保存できる編集ツールがあれば、直接 1_4bit_32px.png を編集できる
    • GIMPでは4bitで保存できなかった
  • できない場合には、1_4bit_32px.bmp を編集して Edge で 4bit png へ変換する必要がある
    • 4bit bmp から ico への変換は、icotool に「画像内の透過色を指定するオプション」が見つけられなかったため、背景が透過しないアイコンになってしまう(はず)

ため、4bit は bmp と png を両方コミットしています。

2023-01-19 00:42 Updated by: zmatsuo
Commentaire

PNG マルチアイコンうまく作れたんですね。よかったです。

わかっていたことなんですが、VS2005でビルドするとエラーが出るようになりました。

今のところは置いておきましょう。

Attachment File List

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion