Skip to content

Application icon cleanup #2270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2020
Merged

Application icon cleanup #2270

merged 1 commit into from
Jun 6, 2020

Conversation

scottfurry
Copy link
Contributor

Ensure images used for application icon are a "best quality" image
with consistent square size. A sharp, square image is vital for downstream
usage/installation.

File images/logo.svg was taken as canonical source. File was edited in
inkscape. It's document properties were cleaned up(incl. image metadata).
Document viewport was made to be a large size and square(256px^2).
Image itself was resized to ensure an 8px margin.

File images/logo.png was created from svg (inkscape export to png
command). Image was generated with high compression as well as ensuring
an alpha layer and square sizing.

File src/icons/sqlitebrowser.png was copied from images/logo.png.

Ensure images used for application icon are a "best quality" image
with consistent square size. A sharp, square image is vital for downstream
usage/installation.

File `images/logo.svg` was taken as canonical source. File was edited in
inkscape. It's document properties were cleaned up(incl. image metadata).
Document viewport was made to be a large size and square(256px^2).
Image itself was resized to ensure an 8px margin.

File `images/logo.png` was created from svg (inkscape `export to png`
command). Image was generated with high compression as well as ensuring
an alpha layer and square sizing.

File `src/icons/sqlitebrowser.png` was copied from `images/logo.png`.
@scottfurry
Copy link
Contributor Author

scottfurry commented Jun 5, 2020

@justinclift - recommend editing src/tools/create_windows_icon.sh changing line 7 from

	convert ../icons/sqlitebrowser.png -resize "$imgsize"x"$imgsize" -background transparent icon"$imgsize".png

...to:

	convert ../../images/logo.svg -resize "$imgsize"x"$imgsize" -background transparent icon"$imgsize".png

This should ensure the generated icon file has sharp and crisp images rather than scaled, fuzzy images derived from a lossy, binary source.

@justinclift
Copy link
Member

justinclift commented Jun 5, 2020

Is ../icons/sqlitebrowser.svg the correct filename for the convert argument? I'm not seeing it in the source tree, nor in this PR? 😉

@scottfurry
Copy link
Contributor Author

Suggestion was to use svg image in the images folder. My bad for not posting correct info. Updated command suggestion.

@justinclift
Copy link
Member

No worries, wasn't 100% sure. Came back from local Makerspace last night in brain-dead-tired-state. 😄

@justinclift justinclift merged commit 454f182 into sqlitebrowser:master Jun 6, 2020
@justinclift
Copy link
Member

Just added that script tweak, and the newly generated windows icon from it in: ba1c2a1

Thanks heaps @scottfurry. 😄

@justinclift
Copy link
Member

justinclift commented Jun 7, 2020

Hmmm, something is wrong with the newly generated windows icon (all white bg). Seems like an alpha channel problem, but not sure.

DB4S-new_icon_alpha_is_wrong

Discovered when doing final verification of the new v3.12.0-rc1 binaries on Windows. 😦

I'll back out the change there, and regenerate the binaries using the older icon. That'll give us time to figure out what's wrong, and have it fixed in the .1 release. 😄

@justinclift
Copy link
Member

As a data point, this is how the icons used to look on Windows:

DB4S-new_icon_alpha-how_it_should_look

@scottfurry
Copy link
Contributor Author

@justinclift - this looks like an alpha channel issue.
Looking into this.

@scottfurry
Copy link
Contributor Author

Changes below. The extra "MAGICK_CMDS" are things that convert needs BEFORE identifying the image (and why everything went pear shape for us).
Bottom line Order of parameters to convert is vital!!! Previous version of convert script was overlooking that and somehow it all worked out anyway.

#!/usr/bin/env sh

# This script depends on ImageMagick being installed

MAGICK_CMDS="+antialias -units PixelsPerInch -alpha set -background transparent"
for imgsize in 16 32 64 128
do
    RESIZE="${imgsize}x${imgsize}"
    convert ${MAGICK_CMDS} ../../images/logo.svg -resize ${RESIZE} icon"${imgsize}".png
    files="$files icon$imgsize.png"
done
convert $files ../iconwin.ico
rm $files

@justinclift
Copy link
Member

Thanks. Would you be ok to chuck it in a PR so I can just hit the Merge button on it? 😄

@scottfurry
Copy link
Contributor Author

PR to follow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants