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

Autogenerated icons? #395

Closed
dgcampbe opened this issue Sep 20, 2021 · 31 comments
Closed

Autogenerated icons? #395

dgcampbe opened this issue Sep 20, 2021 · 31 comments
Labels
enhancement New feature or request

Comments

@dgcampbe
Copy link
Contributor

I think that a great feature to implement in the future would be that icons that aren't covered by the icon pack could be autogenerated. Instead trying to to convert the app's icon into lines, we could just have an algorithm that takes the name of the app and uses the font to automatically produce an icon with the Apple name. They might not be perfect looking, but having a random "normal" icon in the middle of all the beautiful icons is annoying. This would also be super helpful for creating icons of apps that just have their name on their icon. The algorithm could handle the kerning, etc. for us. I am guessing we might want a true font file instead of an svg of letters to do this.

@joelchrono12
Copy link
Contributor

this sounds actually kinda possible with some imagemagick trickery.

@Donnnno
Copy link
Collaborator

Donnnno commented Sep 20, 2021

That sounds really futuristic and interesting.

There's actually a TTF already of the Arcticons font with decent kerning.

@Donnnno Donnnno added the enhancement New feature or request label Sep 20, 2021
@dgcampbe
Copy link
Contributor Author

For example, the first app I choose to make an icon myself for was "Taimi". I choose it because the icon is just the text "Taimi", about as trivial as it gets. What I did was copy and paste each letter from the svg of letters and tried to center them with decent kerning. Instead of doing this manually, an algorithm would see that an app called "abc xyz" is installed, but not covered by the icon pack. It grabs the needed letters (perhaps from the ttf to handle the kerning automatically as opposed to adjusting it until "meh, that looks decent"). Spaces could become newlines to help formatting and the algorithm should try to pick the best size to leave good-looking margins on the icon. As a fallback (in the case that the name contains characters not covered by the font, etc.) the original unthemed icon could be used. Some names will require weird formatting to fit, but I think that generally, an oddly formatted icon that matches the icon pack looks nicer than an out-of-place "normal" icon. I know that Nova Launcher allows icon packs to autogenerate icons, but I don't know how it works. There are probably many hundreds of popular apps with icons that are just the name of the app (not very creative imo).

@dgcampbe
Copy link
Contributor Author

This is kinda a separate thing, but I don't know if it warrants its own issue. The readme section on icon requests could use an update since there is now an icon request feature builtin to the app (it still says there isn't) and explain what kind of icons should (or shouldn't) be requested, and perhaps suggest that if one would like an icon added they could try doing it themselves (it is fun to make icons 😄).

@mubashir-rehman
Copy link

i think there shouldn't be any restriction on what icons can be requested because it is upto devs to either cover it or not pull request should be appreciated. @dgcampbe

@Donnnno
Copy link
Collaborator

Donnnno commented Sep 21, 2021

The readme section on icon requests could use an update since there is now an icon request feature builtin to the app

@dgcampbe Yup, gonna do that later :)

an algorithm would see that an app called "abc xyz" is installed

Sounds like a lot of work, but if anyone is willing to give it a try, I'm not against it ;)

i think there shouldn't be any restriction on what icons can be requested

@mubashir-rehman fun fact, for me, there are actually some apps that I won't cover with Arcticons. But it that only goes for apps that promote hate-speech like Gab or Parler. Other than that, there are for example a few icons for certain nsfw-apps in here.

@dgcampbe
Copy link
Contributor Author

Yeah, Gab and Parlor can f--- off! 🤮

@Donnnno
Copy link
Collaborator

Donnnno commented Nov 13, 2021

I think an easier solution would be to just give all the missing icons a standard letter as icon instead of the full name.

@mubashir-rehman
Copy link

I think an easier solution would be to just give all the missing icons a standard letter as icon instead of the full name.

Two letters would be great. If it has one word name than first two letters(first capital and second small). if it has two ore more words in name than first letter of each word(all capital).

@mubashir-rehman
Copy link

if it has more than for words than can(only first and last words will be used)

@lublak
Copy link

lublak commented May 26, 2022

I think auto generate line icons from the real icon can also bei nice. (Edge detection)
There ist an App called adapticons which can Auto generate Icons and generate a Icon Pack from it.
So this could ne also an option.
Build all missing icons to a seperated apk.

https://stackoverflow.com/questions/5827809/canny-edge-detection-using-processing
https://learnopencv.com/edge-detection-using-opencv/

@Donnnno
Copy link
Collaborator

Donnnno commented May 29, 2022

Interesting stuff!
But for now, I think auto-generated icons will never achieve the same level as handcrafted icons.

@lublak
Copy link

lublak commented May 30, 2022

@Donnnno
Of course not. Automatically generated icons should rather be seen as filler for apps that are not yet supported.
Otherwise it looks quite unattractive and it is nicer if there are not quite so good automatically generated icons with a similar look to the hand-generated ones.
Besides, maybe you still have a basis to work on.
And just a side note: A donation function directly in the app via google pay would also be a nice option to support the development of the app. 😉

@dgcampbe
Copy link
Contributor Author

dgcampbe commented Jun 9, 2022

I made a python script that turns the name of an icon into an SVG file containing the paths for the letters in the name using the Arcticons Font TTF file. It is far from perfect, but it might be a start on a script we could use to quickly produce icons without having to manually grab and space letters.
I found these very helpful:
https://developer.mozilla.org/en-US/docs/Web/SVG
fonttools/fonttools#2087

"""Turn an app name into an svg"""

from fontTools.ttLib import TTFont
from fontTools.pens.svgPathPen import SVGPathPen

app_name = input("Please input the name of the app: ")

font = TTFont("Arcticons-Regular.ttf")
os2 = font["OS/2"]
hmtx = font["hmtx"]
glyphset = font.getGlyphSet()
glyphorder = font.getGlyphOrder()
width = "48"
height = "48"
svg = f"""
<?xml version="1.0" standalone="no"?>
<svg viewBox="0 0 {width} {height}" xmlns="http://www.w3.org/2000/svg" version="1.1">
"""
start_x = 0
for char in app_name:
    if char not in [" ", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]:
        glyph = glyphset[char]
        pen = SVGPathPen(glyphset)
        glyph.draw(pen)
        lsb = "1"
        svg += f"""
        <g transform="matrix(0.01 0 0 -0.01 {str(start_x)} 0)">
            <path fill="none" stroke="black" stroke-width="1" stroke-linecap="round" 
             d="{pen.getCommands()}" />
        </g>
        """
        start_x += 5
svg +="""
</svg>
"""
with open(f'{app_name}.svg', "w") as fp:
    fp.write(svg)

@basings
Copy link
Contributor

basings commented Aug 1, 2022

Just to throw in my 2 cents and give a different view about covering missing icons with placeholders or auto generated (font) icons. I had a couple of apps installed which weren't covered by arcticons. If all those icons would've had a placeholder which is somewhat acceptable, I wouldn't have started designing icons for this pack (currently none of them are included but my point is still valid). If those auto generated icons aren't acceptable, they shouldn't be in the icon pack in the first place. This means, the incentive to design a new icon is the lower the lower the additional benefit of it is.

If you can create acceptable auto generated icons, it should be an additional icon pack. Usually you can combine multiple icon packs in a launcher. People who are interested in it can install the auto generated icon pack and others still have the incentive to design new icons.

@dgcampbe
Copy link
Contributor Author

dgcampbe commented Aug 1, 2022

Good point. Having a script to make icons might still be useful to us since there are many icons that are simply letters. Instead of a human having to fiddle with copying letters by hand and getting the spacing right (and still probably not have pixel perfection), a script could do it and always have good kerning and allignment.

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Aug 3, 2022

No description provided.

@dgcampbe
Copy link
Contributor Author

dgcampbe commented Aug 3, 2022

Looks cool!

@Donnnno
Copy link
Collaborator

Donnnno commented Aug 3, 2022

I can't preview it, but the real challenge would also be to make it work without adding all the combinations to the pack.

like @basings said, maybe something like that fits better in a complimentary icon pack.

@Donnnno
Copy link
Collaborator

Donnnno commented Aug 3, 2022

Also, and this is an issue from my side, the font weight has to match the Arcticons stroke weight, right now they're different.

I've tought on how to change that accordingly, the font file right now was kinda an experiment. The cool solution would be to use the svg file somehow and place it at the good spaces.

@kaanelloed
Copy link
Contributor

I started a small application that creates a complementary icon pack with the edge detection algorithm discussed above. It's not great right now, but it does the trick.

https://codeberg.org/kaanelloed/Iconeration

@Donnnno
Copy link
Collaborator

Donnnno commented Dec 30, 2022

Hey @kaanelloed ! Wow, this is actually super interesting how you managed to make it work.

@kaanelloed
Copy link
Contributor

kaanelloed commented Dec 31, 2022

Thanks ! I'll try to add other type of generated icons, like letters with Arcticons font/SVG.

@kaanelloed
Copy link
Contributor

It's still experimental, but you can try the lastest release

@dgcampbe
Copy link
Contributor Author

dgcampbe commented Jan 1, 2023

I am really excited to have a script to automatically place letters with proper spacing to make icons.

@Donnnno
Copy link
Collaborator

Donnnno commented Jan 1, 2023

Wow, the new options are cool! Amazing work

@RokeJulianLockhart
Copy link

How do you activate this? I just installed Arcticons Light from Play Store, but didn't see an option to enable automatic generation.

@mubashir-rehman
Copy link

@kaanelloed
Copy link
Contributor

How do you activate this? I just installed Arcticons Light from Play Store, but didn't see an option to enable automatic generation.

It's not in the Arcticons app, it's in a separate app.
If you want to test it : https://codeberg.org/kaanelloed/Iconeration/releases

@Donnnno
Copy link
Collaborator

Donnnno commented Feb 5, 2023

Included this in the latest release

Screenshot_20230205_183317_Arcticons Dark.jpg

@Donnnno
Copy link
Collaborator

Donnnno commented Feb 13, 2023

Moving this discussion to #1448

@Donnnno Donnnno closed this as completed Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants