From: Ben Soares Date: Fri, 1 Oct 2021 11:08:16 +0000 (+0100) Subject: JAL-3594 New Jalview Test logos and .icns/.ico creation helper script X-Git-Tag: Release_2_11_2_0~29^2~1^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=69344c80b438aa373e041540d368da1d7f74d2cb;p=jalview.git JAL-3594 New Jalview Test logos and .icns/.ico creation helper script --- diff --git a/utils/install4j/README-DMG_background_image_creation.md b/doc/README-DMG_background_image_creation.md similarity index 100% rename from utils/install4j/README-DMG_background_image_creation.md rename to doc/README-DMG_background_image_creation.md diff --git a/utils/install4j/README-DMG_creation.md b/doc/README-DMG_creation.md similarity index 100% rename from utils/install4j/README-DMG_creation.md rename to doc/README-DMG_creation.md diff --git a/utils/install4j/README_convert_PNG_to_ICNS_and_ICO b/doc/README_convert_PNG_to_ICNS_and_ICO similarity index 64% rename from utils/install4j/README_convert_PNG_to_ICNS_and_ICO rename to doc/README_convert_PNG_to_ICNS_and_ICO index 393754e..11892e0 100644 --- a/utils/install4j/README_convert_PNG_to_ICNS_and_ICO +++ b/doc/README_convert_PNG_to_ICNS_and_ICO @@ -1,4 +1,23 @@ -## Creating the .ico (Windows) and .icns (macOS) files from PNG images in linux +## There is now a script utils/mk_jalview_icons.sh that creates the .icns and .ico icon files, and also the rotatable icon. +Run it as +``` +mk_jalview_icons.sh -512.png +``` +Having an existing 512x512 PNG image with the above filename format is important. +It will then create multiple files +`-.png` +for N being 16, 32, 38, 48, 64, 128, 256. +**NB** You might want to edit these as described below. The `mk_jalview_icons.sh` will not overwrite these files, but it +will overwrite the `.ico` and `.icns` files, so after editing the `-.png` files, just run the script again. + +As below, the script relies on ImageMagick and icnsutils being installed with `convert` and `png2icns` in the PATH. + +The rotatable logo will also be created (and overwritten) as +`rotatable_-38.png` + + +## Old text +### Creating the .ico (Windows) and .icns (macOS) files from PNG images in linux Create multiple square versions of your icon at the following resolutions: 16x16, 32x32, 48x48, 64x64, 128x128, 256x256, 512x512 diff --git a/utils/channels/release/images/jalview_logo.svg b/utils/channels/release/images/jalview_logo.svg index c7f3dba..d2ebdec 100644 --- a/utils/channels/release/images/jalview_logo.svg +++ b/utils/channels/release/images/jalview_logo.svg @@ -1,33 +1,133 @@ - + - - - - - - - - - - - - - - - - - - - - + +image/svg+xml + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/channels/test-release/images/jalview_test-release_banner.xcf b/utils/channels/test-release/images/jalview_test-release_banner.xcf index 9eddfbf..a5b6be1 100644 Binary files a/utils/channels/test-release/images/jalview_test-release_banner.xcf and b/utils/channels/test-release/images/jalview_test-release_banner.xcf differ diff --git a/utils/channels/test-release/images/jalview_test-release_getdown_background.png b/utils/channels/test-release/images/jalview_test-release_getdown_background.png index d400307..ba614d9 100644 Binary files a/utils/channels/test-release/images/jalview_test-release_getdown_background.png and b/utils/channels/test-release/images/jalview_test-release_getdown_background.png differ diff --git a/utils/channels/test-release/images/jalview_test-release_getdown_background.xcf b/utils/channels/test-release/images/jalview_test-release_getdown_background.xcf index 8eea296..4f0f355 100644 Binary files a/utils/channels/test-release/images/jalview_test-release_getdown_background.xcf and b/utils/channels/test-release/images/jalview_test-release_getdown_background.xcf differ diff --git a/utils/channels/test-release/images/jalview_test-release_getdown_background_error.png b/utils/channels/test-release/images/jalview_test-release_getdown_background_error.png index df9a543..cb34bce 100644 Binary files a/utils/channels/test-release/images/jalview_test-release_getdown_background_error.png and b/utils/channels/test-release/images/jalview_test-release_getdown_background_error.png differ diff --git a/utils/channels/test-release/images/jalview_test-release_getdown_background_initialising.png b/utils/channels/test-release/images/jalview_test-release_getdown_background_initialising.png index 1693d2d..fa24e1f 100644 Binary files a/utils/channels/test-release/images/jalview_test-release_getdown_background_initialising.png and b/utils/channels/test-release/images/jalview_test-release_getdown_background_initialising.png differ diff --git a/utils/channels/test-release/images/jalview_test-release_logo-84.png b/utils/channels/test-release/images/jalview_test-release_logo-84.png new file mode 100644 index 0000000..57ee645 Binary files /dev/null and b/utils/channels/test-release/images/jalview_test-release_logo-84.png differ diff --git a/utils/channels/test-release/images/jalview_test-release_logo-88.png b/utils/channels/test-release/images/jalview_test-release_logo-88.png new file mode 100644 index 0000000..15c2111 Binary files /dev/null and b/utils/channels/test-release/images/jalview_test-release_logo-88.png differ diff --git a/utils/channels/test-release/images/jalview_test-release_logo.icns b/utils/channels/test-release/images/jalview_test-release_logo.icns index c6eac9c..ac3b0a6 100644 Binary files a/utils/channels/test-release/images/jalview_test-release_logo.icns and b/utils/channels/test-release/images/jalview_test-release_logo.icns differ diff --git a/utils/channels/test-release/images/jalview_test-release_logo.ico b/utils/channels/test-release/images/jalview_test-release_logo.ico index 714c0e0..c86bbac 100644 Binary files a/utils/channels/test-release/images/jalview_test-release_logo.ico and b/utils/channels/test-release/images/jalview_test-release_logo.ico differ diff --git a/utils/channels/test-release/images/jalview_test-release_logo.png b/utils/channels/test-release/images/jalview_test-release_logo.png index 301bcb0..623ffaa 100644 Binary files a/utils/channels/test-release/images/jalview_test-release_logo.png and b/utils/channels/test-release/images/jalview_test-release_logo.png differ diff --git a/utils/channels/test-release/images/jalview_test-release_logo.svg b/utils/channels/test-release/images/jalview_test-release_logo.svg index b9c5f25..f9b05b8 100644 --- a/utils/channels/test-release/images/jalview_test-release_logo.svg +++ b/utils/channels/test-release/images/jalview_test-release_logo.svg @@ -13,19 +13,19 @@ id="Layer_1" x="0px" y="0px" - width="522.492" - height="522.492" - viewBox="0 0 522.49203 522.49203" + width="522.09399" + height="522.09399" + viewBox="0 0 522.09402 522.09402" enable-background="new 0 0 595.238 595.238" xml:space="preserve" - sodipodi:docname="jalview_test_logo4.svg" + sodipodi:docname="jalview_test-release_logo.svg" inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)" - inkscape:export-filename="/home/bsoares/Work/git/develop/jalview/utils/channels/test-release/images/jalview_test_logo4.png" + inkscape:export-filename="/home/bsoares/Work/git/develop/jalview/utils/channels/tmp/jalview_test-release_logo-512.png" inkscape:export-xdpi="94.139999" inkscape:export-ydpi="94.139999">image/svg+xml - - - - - - - - - - - - - - - - - - \ No newline at end of file + fit-margin-bottom="0" + inkscape:zoom="0.56070751" + inkscape:cx="258.83099" + inkscape:cy="260.988" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="Layer_1" /> + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/utils/channels/test-release/resources/images/jalview_test-release_banner.png b/utils/channels/test-release/resources/images/jalview_test-release_banner.png index e34245f..5ba07b8 100644 Binary files a/utils/channels/test-release/resources/images/jalview_test-release_banner.png and b/utils/channels/test-release/resources/images/jalview_test-release_banner.png differ diff --git a/utils/channels/test-release/resources/images/jalview_test-release_logo-128.png b/utils/channels/test-release/resources/images/jalview_test-release_logo-128.png index 7e2c546..5e351f8 100644 Binary files a/utils/channels/test-release/resources/images/jalview_test-release_logo-128.png and b/utils/channels/test-release/resources/images/jalview_test-release_logo-128.png differ diff --git a/utils/channels/test-release/resources/images/jalview_test-release_logo-16.png b/utils/channels/test-release/resources/images/jalview_test-release_logo-16.png index 56c1517..6c398dd 100644 Binary files a/utils/channels/test-release/resources/images/jalview_test-release_logo-16.png and b/utils/channels/test-release/resources/images/jalview_test-release_logo-16.png differ diff --git a/utils/channels/test-release/resources/images/jalview_test-release_logo-256.png b/utils/channels/test-release/resources/images/jalview_test-release_logo-256.png index ec316f6..7f9af58 100644 Binary files a/utils/channels/test-release/resources/images/jalview_test-release_logo-256.png and b/utils/channels/test-release/resources/images/jalview_test-release_logo-256.png differ diff --git a/utils/channels/test-release/resources/images/jalview_test-release_logo-32.png b/utils/channels/test-release/resources/images/jalview_test-release_logo-32.png index b89bb34..ecc0a38 100644 Binary files a/utils/channels/test-release/resources/images/jalview_test-release_logo-32.png and b/utils/channels/test-release/resources/images/jalview_test-release_logo-32.png differ diff --git a/utils/channels/test-release/resources/images/jalview_test-release_logo-38.png b/utils/channels/test-release/resources/images/jalview_test-release_logo-38.png index 233d9d7..5438d4e1 100644 Binary files a/utils/channels/test-release/resources/images/jalview_test-release_logo-38.png and b/utils/channels/test-release/resources/images/jalview_test-release_logo-38.png differ diff --git a/utils/channels/test-release/resources/images/jalview_test-release_logo-48.png b/utils/channels/test-release/resources/images/jalview_test-release_logo-48.png index cfc45b4..108f927 100644 Binary files a/utils/channels/test-release/resources/images/jalview_test-release_logo-48.png and b/utils/channels/test-release/resources/images/jalview_test-release_logo-48.png differ diff --git a/utils/channels/test-release/resources/images/jalview_test-release_logo-512.png b/utils/channels/test-release/resources/images/jalview_test-release_logo-512.png index 301bcb0..623ffaa 100644 Binary files a/utils/channels/test-release/resources/images/jalview_test-release_logo-512.png and b/utils/channels/test-release/resources/images/jalview_test-release_logo-512.png differ diff --git a/utils/channels/test-release/resources/images/jalview_test-release_logo-64.png b/utils/channels/test-release/resources/images/jalview_test-release_logo-64.png index b6cbdb6..a599ba3 100644 Binary files a/utils/channels/test-release/resources/images/jalview_test-release_logo-64.png and b/utils/channels/test-release/resources/images/jalview_test-release_logo-64.png differ diff --git a/utils/channels/test-release/resources/images/rotatable_jalview_test-release_logo-38.png b/utils/channels/test-release/resources/images/rotatable_jalview_test-release_logo-38.png index 2e6fb73..53b6ec7 100644 Binary files a/utils/channels/test-release/resources/images/rotatable_jalview_test-release_logo-38.png and b/utils/channels/test-release/resources/images/rotatable_jalview_test-release_logo-38.png differ diff --git a/utils/create_iconfiles.sh b/utils/create_iconfiles.sh deleted file mode 100755 index 241c195..0000000 --- a/utils/create_iconfiles.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -# given a list of differently sized png files with the size in the filename like this: -# myiconfile-16.png myiconfile-32.png myiconfile-48.png myiconfile-64.png myiconfile-128.png myiconfile-256.png myiconfile-512.png -# run -# create_iconfiles.sh myiconfile-*.png -# to create an ICO file (for Windows) myiconfile.ico and an ICNS file (for macOS) myiconfile.icns - -BASENAME=${1%-*} -if [ x$BASENAME = x ]; then - echo "Could not calculate basename from '${1}'" - exit 1 -fi - -ICOFILE=${BASENAME}.ico -echo "Creating ${ICOFILE}" -convert $* ${ICOFILE} - -ICNSFILE=${BASENAME}.icns -echo "Creating ${ICNSFILE}" -# dont' include 64x64 icon (for some reason they're not allowed in icns file) -ICNSARGS="" -for ARG in $*; do - NUM=${ARG##*-} - NUM=${NUM%px*} - NUM=${NUM%x*} - NUM=${NUM%.*} - if [ x$NUM != x64 -a x$NUM != x38 ]; then - ICNSARGS="${ICNSARGS} $ARG" - fi -done -png2icns ${ICNSFILE} ${ICNSARGS} diff --git a/utils/mk_jalview_icons.sh b/utils/mk_jalview_icons.sh new file mode 100755 index 0000000..4a2768e --- /dev/null +++ b/utils/mk_jalview_icons.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +FILENAME512=$1 +BASENAME=${FILENAME512%-512.png} + +usage () { + echo "$(basename "$0") -512.png" +} + +[ "$1" = "-h" ] && usage && exit 0 +[ -r "$FILENAME512" ] || ( usage && echo "'${FILENAME512}' must exist and be readable" && exit 1 ) +[ "$BASENAME" = "$FILENAME512" ] && usage && echo "Must have '-512.png' at end of filename" && exit 2 + +set -e + +SIZES="16 32 38 48 64 128 256" +declare -a ICOFILES=() +declare -a ICNSFILES=() +for n in $SIZES +do + NEWFILE="${BASENAME}-${n}.png" + [ -e "{$NEWFILE}" ] && continue + convert -geometry "${n}x${n}" "${BASENAME}-512.png" "${NEWFILE}" + [ "${n}" != 38 ] && ICOFILES=( "${ICOFILES[@]}" "${NEWFILE}" ) + [ "${n}" != 64 ] && [ "${n}" != 38 ] && ICNSFILES=( "${ICNSFILES[@]}" "${NEWFILE}" ) +done + +# make the .ico +ICOFILE="${BASENAME}.ico" +echo "Creating ${ICOFILE}" +convert "${ICOFILES[@]}" "${ICOFILE}" + +# make the .icns +ICNSFILE="${BASENAME}.icns" +echo "Creating ${ICNSFILE}" +png2icns "${ICNSFILE}" "${ICNSFILES[@]}" + +# make the rotatable icon +ROTATABLEFILE="rotatable_${BASENAME}-38.png" +convert "${BASENAME}-38.png" -gravity center -background white -extent 60x60 "${ROTATABLEFILE}" + +exit 0