0

Apple イメージを作成するために必要な別のツールを使用して、既にいくつかの Mac アプリを作成しています。それらは、アルファ チャネルのない PNG ファイルとして作成され、フォルダーに保存されました。

次のコマンドを実行しようとしました。

iconutil -c icons myfolder.iconset

以下のような複数のエラーが発生しました。

iconutil error: Unsuported image format

このブログ投稿と Stack Overflow に関するいくつかの投稿を読んだ後、画像にアルファ チャネルが必要であることがわかりました。これは、Apple Developer のドキュメントには記載されていません。

これにはプレビューを使用してみましたが、いくつかのビデオを見るなど、行った調査から、アイコン、特に小さいアイコンを台無しにする色を削除する必要がありました。私のアイコンの背景は黒く、その上にある小さな白いものを削除しようとすると、小さなアイコンにとっては悪夢になります。

このリンクには David Grayson によるコメントがあり、ImageMagick を使用してアルファ チャネルを追加できると述べています。コメントは、動作するはずの各pngファイルに対して次のコマンドを実行すると述べました。

convert old_icon_16x16.png -define png:color-type=6 icon_16x16.png

ただし、これを実行すると、次のエラーが発生します。

Abort trap: 6

次に、例としてメインの ImageMagick Web サイトで参照されているこのリンクにアクセスしました。次のコマンドを試しました。

convert old_icon_16x16.png -alpha off -alpha on icon_16x16.png

次のエラーが発生しました。

Abort trap: 6

ここからどこへ行けばいいのかわからない。

4

1 に答える 1

1

Abortまたはを取得している場合はSegmentation Faults、ImageMagick のコンパイル/ビルド/リンクが一致していない可能性があります。

homebrewインストールした ImageMagick をすべて削除し、OSX に ImageMagick をインストールする最も簡単な方法からやり直すことをお勧めします。基本的には、Homebrew の Web サイトにアクセスし、ワンライナーをコピーしてターミナルに貼り付けてインストールします (将来変更されて古くなった場合に備えて、ここでは行を表示したくありません)。

homebrew をインストールしたら、あとは次の作業だけです。

brew install imagemagick

X11、TIFF、fftw などをサポートするためのオプションを確認したい場合は、次のコマンドを実行してください:

brew options imagemagick

出力

--with-fftw
    Compile with FFTW support
--with-fontconfig
    Build with fontconfig support
--with-ghostscript
    Build with ghostscript support
--with-hdri
    Compile with HDRI support
--with-jp2
    Compile with Jpeg2000 support
--with-liblqr
    Build with liblqr support
--with-librsvg
    Build with librsvg support
--with-libwmf
    Build with libwmf support
--with-little-cms
    Build with little-cms support
--with-little-cms2
    Build with little-cms2 support
--with-openexr
    Build with openexr support
--with-openmp
    Compile with OpenMP support
--with-pango
    Build with pango support
--with-perl
    enable build/install of PerlMagick
--with-quantum-depth-16
    Compile with a quantum depth of 16 bit
--with-quantum-depth-32
    Compile with a quantum depth of 32 bit
--with-quantum-depth-8
    Compile with a quantum depth of 8 bit
--with-webp
    Build with webp support
--with-x11
    Build with x11 support
--without-freetype
    Build without freetype support
--without-jpeg
    Build without jpeg support
--without-libpng
    Build without libpng support
--without-libtiff
    Build without libtiff support
--without-magick-plus-plus
    disable build/install of Magick++
--without-opencl
    Disable OpenCL
--HEAD
    Install HEAD version

次に、次のいずれかを実行できます。

brew install imagemagick --with-hdri --with-librsvg

または、すでに ImageMagick をインストールしている場合は、インストールされているオプションを次のように変更できます。

brew reinstall imagemagick --with-x11 ...

Glenn がコメントで指摘しているように、使用しているコマンドよりも簡単なコマンドはおそらく次のとおりです。

convert old_icon_16x16.png png32:icon_16x16.png

また、バージョン 7 以降にconvertなることに注意してください-現時点ではまだバージョン 6 を提供しています。magickhomebrew

于 2016-05-23T21:21:16.863 に答える