Skip to content
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

Generate all icon assets from single image #1682

Closed
timfish opened this issue Jun 16, 2017 · 12 comments
Closed

Generate all icon assets from single image #1682

timfish opened this issue Jun 16, 2017 · 12 comments
Labels

Comments

@timfish
Copy link
Contributor

timfish commented Jun 16, 2017

With the improved AppX support, there are now a lot of different icon assets required.

It would be great if electron-builder generated all the assets from a single SVG or PNG file. I've been looking at using electron-icon-maker to do this although it doesn't yet support AppX and it appears most of the work is done with icon-gen.

@develar
Copy link
Member

develar commented Jun 16, 2017

Our official statement was and, in general, "is" — it is easy to prepare assets for each platform once and then do not slowdown build or think that someday your app will be with "broken" or not good quality icon.

But your point is valid and, as it is match our mission, feature accepted and will be implemented. Not quite clear is AppX will be supported (cc @surajreddy — is it possible to generate squire icons for AppX easily?).

@timfish
Copy link
Contributor Author

timfish commented Jun 16, 2017

electron-builder could generate the icons in the default paths (or relative to the yml config being run) so the user can check them in or gitignore if they want them generated every time? This would at least encourage best practices but make it very simple to get started.

Are paths in the yml relative to that file?

@develar
Copy link
Member

develar commented Jun 16, 2017

No, it is better to generate it on the fly. But good idea — additional subcommand will be added to generate icons in addition to generation on the fly.

@surajreddy
Copy link
Contributor

@develar @timfish this is possible, but a few notes:

  1. You don't need scaled assets. If you don't include targetsize, etc., you only need 4 assets (StoreLogo.png, Square150x150Logo.png, Wide310x150Logo.png, Square44x44Logo.png)

  2. There are some plugins like this that enables creating these assets easier: https://www.npmjs.com/package/svg2uwptiles

However, automatic asset generation like this is not ideal for everyone, because the logo by itself can look really bad in the splash screen and start tile areas. But like @develar mentioned, having this as an additional subcommand is a good idea.

@surajreddy
Copy link
Contributor

Also, Visual Studio Community Edition has a tool that generates assets for you. (You can get to it by creating a blank visual studio uwp app project, and editing the AppXManifest file)

^ This is just an extra link for those who want to create their icons manually, it's not easy to automate this.

@black-snow
Copy link
Contributor

black-snow commented Jun 16, 2017

VS2017 has the asset tool built-in, I think. For earlier versions there's this.

@develar
Copy link
Member

develar commented Jun 17, 2017

jimp was initially rejected because quality of images is very important. Not clear is it still actual.

@timfish
Copy link
Contributor Author

timfish commented Jun 25, 2017

Its also worth noting that for my application at least, I have

  • Application icon
  • Variation used for fileAssociations

So it would be great if anywhere the default icon can be overridden, they can be generated from SVG/PNG files too. 😄

@black-snow
Copy link
Contributor

The generation was appx specific whereas fileAssociations work x-platform (am I right?). I don't think there's much need for creating other icons within the build flow.

I'm not sure I understood what you're asking for. You should be able to set custom icons for fileAssociations. Why would you want to generate them? There isn't a kajillion different sizes, scales and other versions for them, right?

@timfish
Copy link
Contributor Author

timfish commented Jun 26, 2017

electron-icon-maker currently generates icons for Windows/Linux/Mac so when opening this issue I was suggesting it covers generating app icons for ALL the platforms from a single SVG/PNG file. That means from a single file it will generate .ico, .icns, multiple XxY.png's for Linux and multiple XxY.png's for AppX where required.

fileAssociations.icon requires both .ico, .icns so the same code which generates the above could work here too...

@develar
Copy link
Member

develar commented Jan 5, 2018

Upcoming 19.54.0:

  • icns generation from icon set (dir with PNG files). At least 512x512 is required.
  • icns generation from one PNG file. At least 512x512 is required.

For Linux no icon set generation — Linux Zoo accepts one PNG file. One improvement here — now you can specify one PNG file instead of icon set.

Implementation — obviously, we cannot use icon-gen or any other existing NodeJS implementation. Implemented in portable and pure Go.

develar added a commit to develar/electron-builder that referenced this issue Jan 6, 2018
develar added a commit to develar/electron-builder that referenced this issue Jan 8, 2018
develar added a commit to develar/electron-builder that referenced this issue Jan 8, 2018
develar added a commit to develar/electron-builder that referenced this issue Jan 8, 2018
develar added a commit to develar/electron-builder that referenced this issue Jan 8, 2018
develar added a commit to develar/electron-builder that referenced this issue Jan 9, 2018
develar added a commit to develar/electron-builder that referenced this issue Jan 9, 2018
@develar develar closed this as completed Jan 16, 2018
@haoxi911
Copy link

haoxi911 commented Mar 8, 2024

Hello everyone, I found the free Windows app App Icon Maker works well on generating different icons from the same image for APPX package. Is there a better way to do this in 2024?

image

undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue May 4, 2024
This commit refactors the icon and logo generation process by replacing
multiple dependencies with ImageMagick. This simplifies the build
process and enhances maintainability.

Key changes:

- Remove unnecessary icon files for macOS (.icns) and Linux
  (size-specific PNGs). Electron-builder can now auto-generate these
  from a single `logo.png` starting from version 19.54.0, see:
  - electron-userland/electron-builder#1682
  - electron-userland/electron-builder#2533
- Retain `ico` generation with multiple sizes to fix pixelated/bad
  looking icons on Windows, see:
  - electron-userland/electron-builder#7328
  - electron-userland/electron-builder#3867
- Replaced `svgexport`, `icon-gen`, and `electron-icon-builder`
  dependencies with ImageMagick, addressing issues with outdated
  dependencies and unreliable CI/CD builds.
- Move electron-builder build resources to
  `src/presentation/electron/build` for better project structure.
- Improve `electron-builder` configuration file by making it
  importable/reusable without prebuilding the Electron application.
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue May 4, 2024
This commit refactors the icon and logo generation process by replacing
multiple dependencies with ImageMagick. This simplifies the build
process and enhances maintainability.

Key changes:

- Remove unnecessary icon files for macOS (.icns) and Linux
  (size-specific PNGs). Electron-builder can now auto-generate these
  from a single `logo.png` starting from version 19.54.0, see:
  - electron-userland/electron-builder#1682
  - electron-userland/electron-builder#2533
- Retain `ico` generation with multiple sizes to fix pixelated/bad
  looking icons on Windows, see:
  - electron-userland/electron-builder#7328
  - electron-userland/electron-builder#3867
- Replaced `svgexport`, `icon-gen`, and `electron-icon-builder`
  dependencies with ImageMagick, addressing issues with outdated
  dependencies and unreliable CI/CD builds.
- Move electron-builder build resources to
  `src/presentation/electron/build` for better project structure.
- Improve `electron-builder` configuration file by making it
  importable/reusable without prebuilding the Electron application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants