LoginSignup
2
4

More than 5 years have passed since last update.

白黒画像からAndroid通知用アイコンic_notification.pngを作る

Posted at

ImageMagick を使って白黒のグレースケール画像から、白の部分のみをイキにして、黒の部分を透過にして、透過PNGを作成して、Android アプリの通知用アイコン ic_notification.png をコマンドラインで生成する手順。

# 白黒グレースケール画像から、黒の部分を透過に抜く。白の部分はイキ
convert black.png -background white -channel a -combine white.png

# dpi 別のフォルダ
mkdir mipmap-mdpi mipmap-hdpi mipmap-xhdpi mipmap-xxhdpi mipmap-xxxhdpi

# xxxhdpi: 96x96
convert white.png -resize 96x96 mipmap-xxxhdpi/ic_notification.png

# xxhdpi: 72x72
convert white.png -resize 72x72 mipmap-xxhdpi/ic_notification.png

# xhdpi: 48x48
convert white.png -resize 48x48 mipmap-xhdpi/ic_notification.png

# hdpi: 36x36
convert white.png -resize 36x36 mipmap-hdpi/ic_notification.png

# mdpi: 24x24
convert white.png -resize 24x24 mipmap-mdpi/ic_notification.png

関連記事:iPhone用アプリアイコン画像からAndroid用画像をImageMagickで一発生成する

2
4
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
2
4